|
@@ -75,6 +75,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
|
|
if (this.get('stages').someProperty('isError', true)) {
|
|
if (this.get('stages').someProperty('isError', true)) {
|
|
var failedStages = this.get('stages').filterProperty('isError', true);
|
|
var failedStages = this.get('stages').filterProperty('isError', true);
|
|
failedStages.setEach('isError', false);
|
|
failedStages.setEach('isError', false);
|
|
|
|
+ failedStages.setEach('isSuccess', false);
|
|
failedStages.setEach('isStarted', false);
|
|
failedStages.setEach('isStarted', false);
|
|
}
|
|
}
|
|
this.moveToNextStage();
|
|
this.moveToNextStage();
|
|
@@ -96,6 +97,8 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
|
|
var runningStage = stages.filterProperty('isStarted', true).findProperty('isCompleted', false);
|
|
var runningStage = stages.filterProperty('isStarted', true).findProperty('isCompleted', false);
|
|
runningStage.set('isStarted', false);
|
|
runningStage.set('isStarted', false);
|
|
this.get('stages').pushObjects(stages);
|
|
this.get('stages').pushObjects(stages);
|
|
|
|
+ } else {
|
|
|
|
+ this.get('stages').pushObjects(stages);
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.loadStages();
|
|
this.loadStages();
|
|
@@ -451,7 +454,11 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
|
|
},
|
|
},
|
|
|
|
|
|
loadClusterConfigsErrorCallback: function (request, ajaxOptions, error) {
|
|
loadClusterConfigsErrorCallback: function (request, ajaxOptions, error) {
|
|
- this.get('stages').findProperty('stage', 'stage3').set('isError', true);
|
|
|
|
|
|
+ var stage3 = this.get('stages').findProperty('stage', 'stage3');
|
|
|
|
+ if (stage3) {
|
|
|
|
+ stage3.set('isSuccess', false);
|
|
|
|
+ stage3.set('isError', true);
|
|
|
|
+ }
|
|
console.log("TRACE: error code status is: " + request.status);
|
|
console.log("TRACE: error code status is: " + request.status);
|
|
},
|
|
},
|
|
|
|
|
|
@@ -504,11 +511,16 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
|
|
if (this.get('noOfWaitingAjaxCalls') == 0) {
|
|
if (this.get('noOfWaitingAjaxCalls') == 0) {
|
|
var currentStage = this.get('stages').findProperty('stage', 'stage3');
|
|
var currentStage = this.get('stages').findProperty('stage', 'stage3');
|
|
currentStage.set('isSuccess', true);
|
|
currentStage.set('isSuccess', true);
|
|
|
|
+ currentStage.set('isError', false);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
applyConfigurationToClusterErrorCallback: function (request, ajaxOptions, error) {
|
|
applyConfigurationToClusterErrorCallback: function (request, ajaxOptions, error) {
|
|
- this.get('stages').findProperty('stage', 'stage3').set('isError', true);
|
|
|
|
|
|
+ var stage3 = this.get('stages').findProperty('stage', 'stage3');
|
|
|
|
+ if (stage3) {
|
|
|
|
+ stage3.set('isSuccess', false);
|
|
|
|
+ stage3.set('isError', true);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -536,10 +548,14 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
|
|
|
|
|
|
getAllConfigurationsSuccessCallback: function (data) {
|
|
getAllConfigurationsSuccessCallback: function (data) {
|
|
console.log("TRACE: In success function for the GET getServiceConfigsFromServer call");
|
|
console.log("TRACE: In success function for the GET getServiceConfigsFromServer call");
|
|
|
|
+ var stage3 = this.get('stages').findProperty('stage', 'stage3');
|
|
this.get('serviceConfigTags').forEach(function (_tag) {
|
|
this.get('serviceConfigTags').forEach(function (_tag) {
|
|
if (!data.items.someProperty('type', _tag.siteName)) {
|
|
if (!data.items.someProperty('type', _tag.siteName)) {
|
|
console.log("Error: Metadata for secure services (secure_configs.js) is having config tags that are not being retrieved from server");
|
|
console.log("Error: Metadata for secure services (secure_configs.js) is having config tags that are not being retrieved from server");
|
|
- this.get('stages').findProperty('stage', 'stage3').set('isError', true);
|
|
|
|
|
|
+ if (stage3) {
|
|
|
|
+ stage3.set('isSuccess', false);
|
|
|
|
+ stage3.set('isError', true);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
_tag.configs = data.items.findProperty('type', _tag.siteName).properties;
|
|
_tag.configs = data.items.findProperty('type', _tag.siteName).properties;
|
|
}, this);
|
|
}, this);
|
|
@@ -548,7 +564,11 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
|
|
},
|
|
},
|
|
|
|
|
|
getAllConfigurationsErrorCallback: function (request, ajaxOptions, error) {
|
|
getAllConfigurationsErrorCallback: function (request, ajaxOptions, error) {
|
|
- this.get('stages').findProperty('stage', 'stage3').set('isError', true);
|
|
|
|
|
|
+ var stage3 = this.get('stages').findProperty('stage', 'stage3');
|
|
|
|
+ if (stage3) {
|
|
|
|
+ stage3.set('isSuccess', false);
|
|
|
|
+ stage3.set('isError', true);
|
|
|
|
+ }
|
|
console.log("TRACE: In error function for the getServiceConfigsFromServer call");
|
|
console.log("TRACE: In error function for the getServiceConfigsFromServer call");
|
|
console.log("TRACE: error code status is: " + request.status);
|
|
console.log("TRACE: error code status is: " + request.status);
|
|
},
|
|
},
|
|
@@ -582,28 +602,32 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
|
|
|
|
|
|
saveStages: function () {
|
|
saveStages: function () {
|
|
var stages = [];
|
|
var stages = [];
|
|
- this.get('stages').forEach(function (_stage) {
|
|
|
|
- var stage = {
|
|
|
|
- name: _stage.get('name'),
|
|
|
|
- stage: _stage.get('stage'),
|
|
|
|
- label: _stage.get('label'),
|
|
|
|
- isPolling: _stage.get('isPolling'),
|
|
|
|
- isStarted: _stage.get('isStarted'),
|
|
|
|
- requestId: _stage.get('requestId'),
|
|
|
|
- isSuccess: _stage.get('isSuccess'),
|
|
|
|
- isError: _stage.get('isError'),
|
|
|
|
- url: _stage.get('url'),
|
|
|
|
- polledData: _stage.get('polledData'),
|
|
|
|
- data: _stage.get('data')
|
|
|
|
- };
|
|
|
|
- stages.pushObject(stage);
|
|
|
|
- }, this);
|
|
|
|
- App.db.setSecurityDeployStages(stages);
|
|
|
|
- App.clusterStatus.setClusterStatus({
|
|
|
|
- clusterName: this.get('clusterName'),
|
|
|
|
- clusterState: 'ADD_SECURITY_STEP_3',
|
|
|
|
- wizardControllerName: App.router.get('addSecurityController.name'),
|
|
|
|
- localdb: App.db.data
|
|
|
|
- });
|
|
|
|
- }.observes('stages.@each.requestId', 'stages.@each.isStarted', 'stages.@each.isCompleted')
|
|
|
|
|
|
+ if (this.get('stages').length === 3) {
|
|
|
|
+ this.get('stages').forEach(function (_stage) {
|
|
|
|
+ var stage = {
|
|
|
|
+ name: _stage.get('name'),
|
|
|
|
+ stage: _stage.get('stage'),
|
|
|
|
+ label: _stage.get('label'),
|
|
|
|
+ isPolling: _stage.get('isPolling'),
|
|
|
|
+ isStarted: _stage.get('isStarted'),
|
|
|
|
+ requestId: _stage.get('requestId'),
|
|
|
|
+ isSuccess: _stage.get('isSuccess'),
|
|
|
|
+ isError: _stage.get('isError'),
|
|
|
|
+ url: _stage.get('url'),
|
|
|
|
+ polledData: _stage.get('polledData'),
|
|
|
|
+ data: _stage.get('data')
|
|
|
|
+ };
|
|
|
|
+ stages.pushObject(stage);
|
|
|
|
+ }, this);
|
|
|
|
+ App.db.setSecurityDeployStages(stages);
|
|
|
|
+ if (!App.testMode) {
|
|
|
|
+ App.clusterStatus.setClusterStatus({
|
|
|
|
+ clusterName: this.get('clusterName'),
|
|
|
|
+ clusterState: 'ADD_SECURITY_STEP_3',
|
|
|
|
+ wizardControllerName: App.router.get('addSecurityController.name'),
|
|
|
|
+ localdb: App.db.data.AddSecurity
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }.observes('stages.@each.requestId')
|
|
});
|
|
});
|