浏览代码

AMBARI-7195. Wizard Step 7 "Next"-click issue. (onechiporenko)

Oleg Nechiporenko 10 年之前
父节点
当前提交
3d29c28057

+ 15 - 4
ambari-web/app/controllers/wizard/step7_controller.js

@@ -43,6 +43,12 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
 
   slaveHostToGroup: null,
 
+  /**
+   * Is Submit-click processing now
+   * @type {bool}
+   */
+  submitButtonClicked: false,
+
   isRecommendedLoaded: false,
   /**
    * used in services_config.js view to mark a config with security icon
@@ -136,8 +142,9 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
    */
   isSubmitDisabled: function () {
     if (!this.get('stepConfigs.length')) return true;
+    if (this.get('submitButtonClicked')) return true;
     return (!this.get('stepConfigs').filterProperty('showConfig', true).everyProperty('errorCount', 0) || this.get("miscModalVisible"));
-  }.property('stepConfigs.@each.errorCount', 'miscModalVisible'),
+  }.property('stepConfigs.@each.errorCount', 'miscModalVisible', 'submitButtonClicked'),
 
   /**
    * List of selected to install service names
@@ -241,6 +248,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
    * @method clearStep
    */
   clearStep: function () {
+    this.set('submitButtonClicked', false);
     this.set('isSubmitDisabled', true);
     this.set('isRecommendedLoaded', false);
     this.get('stepConfigs').clear();
@@ -1322,16 +1330,19 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, {
 
   /**
    * Click-handler on Next button
+   * Disable "Submit"-button while server-side processes are running
    * @method submit
    */
   submit: function () {
     if (this.get('isSubmitDisabled')) {
       return;
     }
-    var _this = this;
+    var self = this;
+    this.set('submitButtonClicked', true);
     this.serverSideValidation().done(function () {
-      _this.checkDatabaseConnectionTest().done(function () {
-        _this.resolveHiveMysqlDatabase();
+      self.checkDatabaseConnectionTest().done(function () {
+        self.resolveHiveMysqlDatabase();
+        self.set('submitButtonClicked', false);
       });
     });
   }

+ 2 - 0
ambari-web/app/templates/common/configs/services_config.hbs

@@ -35,6 +35,8 @@
 {{#if controller.isRecommendedLoaded}}
     <p class="loading align-center"></p>
     {{#if isSubmitDisabled}}
+      {{#unless submitButtonClicked}}
         <div class="alert">{{t installer.step7.attentionNeeded}}</div>
+      {{/unless}}
     {{/if}}
 {{/if}}