incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject svn commit: r1490774 - in /incubator/ambari/trunk/ambari-web/app: controllers/wizard/step3_controller.js messages.js templates/wizard/step3.hbs views/wizard/step3_view.js
Date Fri, 07 Jun 2013 18:30:30 GMT
Author: yusaku
Date: Fri Jun  7 18:30:30 2013
New Revision: 1490774

URL: http://svn.apache.org/r1490774
Log:
AMBARI-2315. Misleading to say host checks ok when you have at least one failed register host.
(Oleg Nechiporenko via yusaku)

Modified:
    incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js
    incubator/ambari/trunk/ambari-web/app/messages.js
    incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs
    incubator/ambari/trunk/ambari-web/app/views/wizard/step3_view.js

Modified: incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js?rev=1490774&r1=1490773&r2=1490774&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js (original)
+++ incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js Fri Jun 
7 18:30:30 2013
@@ -458,6 +458,17 @@ App.WizardStep3Controller = Em.Controlle
     }
   },
 
+  allHostsComplete: function() {
+    var result = true;
+    this.get('bootHosts').forEach(function(host) {
+      var status = host.get('bootStatus');
+      if (status != 'REGISTERED' && status != 'FAILED') {
+        result = false;
+      }
+    });
+    return result;
+  }.property('bootHosts.@each.bootStatus'),
+
   registerErrPopup: function (header, message) {
     App.ModalPopup.show({
       header: header,
@@ -643,9 +654,11 @@ App.WizardStep3Controller = Em.Controlle
     }, this);
     return isWarning;
   }.property('warnings'),
+
   isWarningsBoxVisible: function(){
-    return (App.testMode) ? true : !this.get('isSubmitDisabled');
-  }.property('isSubmitDisabled'),
+    return (App.testMode) ? true : this.get('allHostsComplete');
+  }.property('allHostsComplete'),
+
   checksUpdateProgress:0,
   checksUpdateStatus: null,
   /**
@@ -954,7 +967,7 @@ App.WizardStep3Controller = Em.Controlle
 
   back: function () {
     if (this.get('isInstallInProgress')) {
-      return false;
+      return;
     }
     App.router.send('back');
   }

Modified: incubator/ambari/trunk/ambari-web/app/messages.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/messages.js?rev=1490774&r1=1490773&r2=1490774&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/messages.js (original)
+++ incubator/ambari/trunk/ambari-web/app/messages.js Fri Jun  7 18:30:30 2013
@@ -329,7 +329,9 @@ Em.I18n.translations = {
   'installer.step3.warnings.description':'Some warnings were encountered while performing
checks against the above hosts.',
   'installer.step3.warnings.linkText':'Click here to see the warnings.',
   'installer.step3.noWarnings.linkText':'Click here to see the check results.',
-  'installer.step3.warnings.noWarnings':'All host checks were successful.',
+  'installer.step3.warnings.noWarnings':'All host checks passed on {0} registered hosts.',
+  'installer.step3.warnings.fails':'Some warnings were encountered while performing checks
against the {0} registered hosts above',
+  'installer.step3.warnings.someWarnings':'All host checks passed on {0} registered hosts.
Note: Host checks were skipped on {1} 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.removeSelected':'Remove Selected',

Modified: incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs?rev=1490774&r1=1490773&r2=1490774&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs (original)
+++ incubator/ambari/trunk/ambari-web/app/templates/wizard/step3.hbs Fri Jun  7 18:30:30 2013
@@ -125,17 +125,10 @@
     </div>
   </div>
     {{#if isWarningsBoxVisible}}
-      {{#if isHostHaveWarnings}}
-      <div class="alert alert-warn">
-        {{t installer.step3.warnings.description}}<br>
-        <a href="javascript:void(0)" {{action hostWarningsPopup warnings target="controller"}}>{{t
installer.step3.warnings.linkText}}</a>
+      <div {{bindAttr class=":alert view.status"}}>
+        {{view.message}}
+        <a href="#" {{action hostWarningsPopup warnings target="controller"}}>{{view.linkText}}</a>
       </div>
-      {{else}}
-      <div class="alert alert-success">
-        {{t installer.step3.warnings.noWarnings}}
-        <a href="javascript:void(0)" {{action hostWarningsPopup warnings target="controller"}}>{{t
installer.step3.noWarnings.linkText}}</a>
-      </div>
-      {{/if}}
     {{/if}}
   <div class="btn-area">
     <a class="btn pull-left" {{bindAttr disabled="isInstallInProgress"}} {{action back
target="controller"}}>&larr; {{t common.back}}</a>

Modified: incubator/ambari/trunk/ambari-web/app/views/wizard/step3_view.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/wizard/step3_view.js?rev=1490774&r1=1490773&r2=1490774&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/wizard/step3_view.js (original)
+++ incubator/ambari/trunk/ambari-web/app/views/wizard/step3_view.js Fri Jun  7 18:30:30 2013
@@ -26,7 +26,38 @@ App.WizardStep3View = Em.View.extend({
 
   didInsertElement: function () {
     this.get('controller').navigateStep();
-  }
+  },
+
+  message:'',
+  linkText: '',
+  status: '',
+
+  monitorStatuses: function() {
+    var failedHosts = 0;
+    var hosts = this.get('controller.bootHosts');
+    hosts.forEach(function(host) {
+      if (host.get('bootStatus') == 'FAILED') {
+        failedHosts++;
+      }
+    });
+    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 {
+      this.set('status', 'alert-success');
+      this.set('linkText', Em.I18n.t('installer.step3.noWarnings.linkText'));
+      if (failedHosts == 0) {
+        // all are ok
+        this.set('message', Em.I18n.t('installer.step3.warnings.noWarnings').format(hosts.length));
+      }
+      else {
+          // some failed
+          this.set('message', Em.I18n.t('installer.step3.warnings.someWarnings').format(hosts.length,
failedHosts));
+      }
+    }
+  }.observes('controller.isHostHaveWarnings', 'controller.bootHosts.@each.bootStatus')
 });
 
 //todo: move it inside WizardStep3View



Mime
View raw message