|
@@ -19,11 +19,18 @@
|
|
|
App.WizardStep12Controller = App.MainServiceInfoConfigsController.extend({
|
|
|
|
|
|
modifiedConfigs: [],
|
|
|
+ oldConfigs: [],
|
|
|
|
|
|
afterLoad: function () {
|
|
|
if (this.get('dataIsLoaded')) {
|
|
|
this.get('stepConfigs').objectAt(0).get('configs').filterProperty('isEditable', false).setEach('isEditable', true);
|
|
|
this.get('stepConfigs').objectAt(0).get('configs').filterProperty('displayType', 'masterHost').setEach('isVisible', false);
|
|
|
+ this.get('oldConfigs').clear();
|
|
|
+ this.get('modifiedConfigs').clear();
|
|
|
+ this.get('stepConfigs').objectAt(0).get('configs').forEach(function (config) {
|
|
|
+ this.get('oldConfigs').push(jQuery.extend({}, config));
|
|
|
+ }, this
|
|
|
+ );
|
|
|
}
|
|
|
}.observes('dataIsLoaded'),
|
|
|
|
|
@@ -43,18 +50,16 @@ App.WizardStep12Controller = App.MainServiceInfoConfigsController.extend({
|
|
|
if (this.get('isSubmitDisabled')) {
|
|
|
return false;
|
|
|
}
|
|
|
- var self = this;
|
|
|
- this.get('modifiedConfigs').clear();
|
|
|
this.get('stepConfigs').objectAt(0).get('configs').forEach(function (config) {
|
|
|
- if (config.get('defaultValue') !== config.get('value')) {
|
|
|
- self.get('modifiedConfigs').push({
|
|
|
+ var oldConfig = this.get('oldConfigs').filterProperty('name', config.get('name')).findProperty('id', config.get('id'));
|
|
|
+ if (!oldConfig || oldConfig.get('value') !== config.get('value')) {
|
|
|
+ this.get('modifiedConfigs').push({
|
|
|
name: config.get('displayName'),
|
|
|
- oldValue: config.get('defaultValue'),
|
|
|
- value: config.get('value'),
|
|
|
- unit: config.get('unit') || false
|
|
|
+ oldValue: !oldConfig ? 'null' : oldConfig.get('value') + ' ' + (oldConfig.get('unit') || ''),
|
|
|
+ value: config.get('value') + ' ' + (config.get('unit') || '')
|
|
|
});
|
|
|
}
|
|
|
- });
|
|
|
+ }, this);
|
|
|
App.router.send('next');
|
|
|
}
|
|
|
});
|