|
@@ -73,6 +73,18 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
|
|
|
*/
|
|
|
submitDisabled: false,
|
|
|
|
|
|
+ /**
|
|
|
+ * timer for validation request
|
|
|
+ */
|
|
|
+ timer: null,
|
|
|
+
|
|
|
+ /**
|
|
|
+ * true if request for validation is in progress
|
|
|
+ *
|
|
|
+ * @type {bool}
|
|
|
+ */
|
|
|
+ validationInProgress: false,
|
|
|
+
|
|
|
/**
|
|
|
* Check if <code>addHostWizard</code> used
|
|
|
* @type {bool}
|
|
@@ -548,15 +560,24 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
|
|
|
},
|
|
|
|
|
|
callValidation: function (successCallback) {
|
|
|
- this.callServerSideValidation(successCallback);
|
|
|
+ var self = this;
|
|
|
+ clearTimeout(this.get('timer'));
|
|
|
+ this.set('timer', setTimeout(function() {
|
|
|
+ if (self.get('validationInProgress')) {
|
|
|
+ self.callValidation(successCallback);
|
|
|
+ } else {
|
|
|
+ self.callServerSideValidation(successCallback);
|
|
|
+ }
|
|
|
+ }, 700));
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* Update submit button status
|
|
|
- * @metohd callServerSideValidation
|
|
|
+ * @method callServerSideValidation
|
|
|
*/
|
|
|
callServerSideValidation: function (successCallback) {
|
|
|
var self = this;
|
|
|
+ this.set('validationInProgress', true);
|
|
|
|
|
|
var selectedServices = App.StackService.find().filterProperty('isSelected').mapProperty('serviceName');
|
|
|
var installedServices = App.StackService.find().filterProperty('isInstalled').mapProperty('serviceName');
|
|
@@ -615,6 +636,7 @@ App.WizardStep6Controller = Em.Controller.extend(App.BlueprintMixin, {
|
|
|
error: 'updateValidationsErrorCallback'
|
|
|
}).
|
|
|
then(function () {
|
|
|
+ self.set('validationInProgress', false);
|
|
|
if (!self.get('submitDisabled') && successCallback) {
|
|
|
successCallback();
|
|
|
}
|