Browse Source

AMBARI-2952. Installer wizard: Host check label says all hosts passed when all hosts are deleted by user. (Andrii Babiichuk via yusaku)

Yusaku Sako 11 years ago
parent
commit
fb20eab51a
2 changed files with 7 additions and 3 deletions
  1. 1 0
      ambari-web/app/messages.js
  2. 6 3
      ambari-web/app/views/wizard/step3_view.js

+ 1 - 0
ambari-web/app/messages.js

@@ -389,6 +389,7 @@ Em.I18n.translations = {
   'installer.step3.warnings.allFailed':'Host checks were skipped on {0} hosts that failed to register.',
   'installer.step3.warnings.updateChecks.success':'Host Checks successfully updated',
   'installer.step3.warnings.updateChecks.failed':'Host Checks update failed',
+  'installer.step3.warnings.missingHosts':'There is no registered host',
   'installer.step3.removeSelected':'Remove Selected',
   'installer.step3.retryFailed':'Retry Failed',
   'installer.step3.hosts.status.registering':'Registering',

+ 6 - 3
ambari-web/app/views/wizard/step3_view.js

@@ -40,12 +40,15 @@ App.WizardStep3View = Em.View.extend({
         failedHosts++;
       }
     });
-    if (this.get('controller.isHostHaveWarnings')) {
+    if (hosts.length==0) {
+      this.set('status', 'alert-warn');
+      this.set('linkText', '');
+      this.set('message', Em.I18n.t('installer.step3.warnings.missingHosts'));
+    } else if (this.get('controller.isHostHaveWarnings')) {
       this.set('status', 'alert-warn');
       this.set('linkText', Em.I18n.t('installer.step3.warnings.linkText'));
       this.set('message', Em.I18n.t('installer.step3.warnings.fails').format(hosts.length, failedHosts));
-    }
-    else {
+    } else {
       this.set('status', 'alert-success');
       this.set('linkText', Em.I18n.t('installer.step3.noWarnings.linkText'));
       if (failedHosts == 0) {