ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject [1/2] git commit: AMBARI-4050 Installer: 1-3 steps enabled when deploy is running. (ababiichuk)
Date Thu, 12 Dec 2013 12:40:43 GMT
Updated Branches:
  refs/heads/trunk 8dac3f1a8 -> cf811e2c2


AMBARI-4050 Installer: 1-3 steps enabled when deploy is running. (ababiichuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/66e1f0d2
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/66e1f0d2
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/66e1f0d2

Branch: refs/heads/trunk
Commit: 66e1f0d2c47d81cfce055765c755ec8c35bb4134
Parents: 8dac3f1
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Thu Dec 12 14:15:38 2013 +0200
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Thu Dec 12 14:17:31 2013 +0200

----------------------------------------------------------------------
 .../app/controllers/wizard/step3_controller.js  | 44 +++++++++-----------
 1 file changed, 19 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/66e1f0d2/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js
index dace005..63a79da 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -271,17 +271,22 @@ App.WizardStep3Controller = Em.Controller.extend({
     this.doBootstrap();
   },
 
-  isInstallInProgress: function(){
-    var bootStatuses = this.get('bootHosts').getEach('bootStatus');
-    if(bootStatuses.length &&
-      (bootStatuses.contains('REGISTERING') ||
-        bootStatuses.contains('DONE') ||
-        bootStatuses.contains('RUNNING') ||
-        bootStatuses.contains('PENDING'))){
-      return true;
-    }
-    return false;
-  }.property('bootHosts.@each.bootStatus'),
+  installationProcess: function() {
+    Ember.run.once(this, 'setInstallationInProgress');
+  }.observes('bootHosts.@each.bootStatus'),
+
+  isInstallInProgress: true,
+
+  setInstallationInProgress: function() {
+    var result = false;
+    this.get('bootHosts').forEach(function(host) {
+      var status = host.get('bootStatus');
+      if (status != 'REGISTERED' && status != 'FAILED') {
+        result = true;
+      }
+    });
+    this.set('isInstallInProgress',result);
+  },
 
   disablePreviousSteps: function(){
     if(this.get('isInstallInProgress')){
@@ -292,7 +297,7 @@ App.WizardStep3Controller = Em.Controller.extend({
         if(step.step >= 0 && step.step <= 2) return true;
       }).setEach('value', false);
     }
-  }.observes('isInstallInProgress'),
+  }.observes('isInstallInProgress','isLoaded'),
 
   doBootstrap: function () {
     if (this.get('stopBootstrap')) {
@@ -503,17 +508,6 @@ App.WizardStep3Controller = Em.Controller.extend({
     }
   },
 
-  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,
@@ -736,8 +730,8 @@ App.WizardStep3Controller = Em.Controller.extend({
   }.property('warnings'),
 
   isWarningsBoxVisible: function(){
-    return (App.testMode) ? true : this.get('allHostsComplete');
-  }.property('allHostsComplete'),
+    return (App.testMode) ? true : !this.get('isInstallInProgress');
+  }.property('isInstallInProgress'),
 
   checksUpdateProgress:0,
   checksUpdateStatus: null,


Mime
View raw message