瀏覽代碼

AMBARI-3033 Incorrect "Add Hosts" behaviour when go to previous wizard step during preparing to deploy

atkach 11 年之前
父節點
當前提交
ca47b36dfa

+ 8 - 0
ambari-web/app/controllers/wizard/step8_controller.js

@@ -34,6 +34,7 @@ App.WizardStep8Controller = Em.Controller.extend({
 
   slaveComponentConfig: null,
   isSubmitDisabled: false,
+  isBackBtnDisabled: false,
   hasErrorOccurred: false,
   servicesInstalled: false,
   securityEnabled: false,
@@ -83,6 +84,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     this.loadClusterInfo();
     this.loadServices();
     this.set('isSubmitDisabled', false);
+    this.set('isBackBtnDisabled', false);
   },
   /**
    * replace whitespace character with coma between directories
@@ -831,6 +833,10 @@ App.WizardStep8Controller = Em.Controller.extend({
 
   submitProceed: function() {
     this.set('isSubmitDisabled', true);
+    this.set('isBackBtnDisabled', true);
+    if (this.get('content.controllerName') == 'addHostController') {
+      App.router.get('addHostController').setLowerStepsDisable(4);
+    }
 
     // checkpoint the cluster status on the server so that the user can resume from where they left off
     switch (this.get('content.controllerName')) {
@@ -1710,6 +1716,8 @@ App.WizardStep8Controller = Em.Controller.extend({
       self.set('hasErrorOccurred', true);
       // an error will break the ajax call chain and allow submission again
       self.set('isSubmitDisabled', false);
+      self.set('isBackBtnDisabled', false);
+      App.router.get(self.get('content.controllerName')).setStepsEnable();
       self.get('ajaxQueue').clear();
       self.set('ajaxBusy', false);
     }

+ 5 - 1
ambari-web/app/routes/add_host_routes.js

@@ -199,7 +199,11 @@ module.exports = Em.Route.extend({
         controller.connectOutlet('wizardStep8', controller.get('content'));
       })
     },
-    back: Em.Router.transitionTo('step3'),
+    back: function(router){
+      if(!router.get('wizardStep8Controller.isBackBtnDisabled')) {
+        router.transitionTo('step3');
+      }
+    },
     next: function (router) {
       var addHostController = router.get('addHostController');
       var wizardStep8Controller = router.get('wizardStep8Controller');

+ 1 - 1
ambari-web/app/templates/wizard/step8.hbs

@@ -58,7 +58,7 @@
     </div>
 </div>
 <div class="btn-area">
-    <a class="btn pull-left" {{action back href="true"}}>&larr; {{t common.back}}</a>
+    <a class="btn pull-left" {{bindAttr disabled="controller.isBackBtnDisabled"}} {{action back}}>&larr; {{t common.back}}</a>
     <a class="btn btn-success pull-right"
        id="spinner" {{bindAttr disabled="controller.isSubmitDisabled"}} {{action submit target="controller"}}>{{t common.deploy}} &rarr;</a>
 </div>