wizard.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. var App = require('app');
  19. App.WizardController = Em.Controller.extend({
  20. isStepDisabled: null,
  21. init: function () {
  22. this.set('isStepDisabled', []);
  23. this.clusters = App.Cluster.find();
  24. this.get('isStepDisabled').pushObject(Ember.Object.create({
  25. step: 1,
  26. value: false
  27. }));
  28. for (var i = 2; i <= this.get('totalSteps'); i++) {
  29. this.get('isStepDisabled').pushObject(Ember.Object.create({
  30. step: i,
  31. value: true
  32. }));
  33. }
  34. },
  35. setStepsEnable: function () {
  36. for (var i = 1; i <= this.totalSteps; i++) {
  37. var step = this.get('isStepDisabled').findProperty('step', i);
  38. if (i <= this.get('currentStep')) {
  39. step.set('value', false);
  40. } else {
  41. step.set('value', true);
  42. }
  43. }
  44. }.observes('currentStep'),
  45. setLowerStepsDisable: function (stepNo) {
  46. for (var i = 1; i < stepNo; i++) {
  47. var step = this.get('isStepDisabled').findProperty('step', i);
  48. step.set('value', true);
  49. }
  50. },
  51. /**
  52. * Set current step to new value.
  53. * Method moved from App.router.setInstallerCurrentStep
  54. * @param currentStep
  55. * @param completed
  56. */
  57. currentStep: function () {
  58. return App.get('router').getWizardCurrentStep(this.get('name').substr(0, this.get('name').length - 10));
  59. }.property(),
  60. /**
  61. * Set current step to new value.
  62. * Method moved from App.router.setInstallerCurrentStep
  63. * @param currentStep
  64. * @param completed
  65. */
  66. setCurrentStep: function (currentStep, completed) {
  67. App.db.setWizardCurrentStep(this.get('name').substr(0, this.get('name').length - 10), currentStep, completed);
  68. this.set('currentStep', currentStep);
  69. },
  70. clusters: null,
  71. isStep0: function () {
  72. return this.get('currentStep') == 0;
  73. }.property('currentStep'),
  74. isStep1: function () {
  75. return this.get('currentStep') == 1;
  76. }.property('currentStep'),
  77. isStep2: function () {
  78. return this.get('currentStep') == 2;
  79. }.property('currentStep'),
  80. isStep3: function () {
  81. return this.get('currentStep') == 3;
  82. }.property('currentStep'),
  83. isStep4: function () {
  84. return this.get('currentStep') == 4;
  85. }.property('currentStep'),
  86. isStep5: function () {
  87. return this.get('currentStep') == 5;
  88. }.property('currentStep'),
  89. isStep6: function () {
  90. return this.get('currentStep') == 6;
  91. }.property('currentStep'),
  92. isStep7: function () {
  93. return this.get('currentStep') == 7;
  94. }.property('currentStep'),
  95. isStep8: function () {
  96. return this.get('currentStep') == 8;
  97. }.property('currentStep'),
  98. isStep9: function () {
  99. return this.get('currentStep') == 9;
  100. }.property('currentStep'),
  101. isStep10: function () {
  102. return this.get('currentStep') == 10;
  103. }.property('currentStep'),
  104. gotoStep: function (step) {
  105. if (this.get('isStepDisabled').findProperty('step', step).get('value') !== false) {
  106. return false;
  107. }
  108. // if going back from Step 9 in Install Wizard, delete the checkpoint so that the user is not redirected
  109. // to Step 9
  110. if (this.get('content.controllerName') == 'installerController' && this.get('currentStep') === '9' && step < 9) {
  111. App.clusterStatus.setClusterStatus({
  112. clusterName: this.get('clusterName'),
  113. clusterState: 'CLUSTER_NOT_CREATED_1',
  114. wizardControllerName: 'installerController',
  115. localdb: App.db.data
  116. });
  117. }
  118. if ((this.get('currentStep') - step) > 1) {
  119. App.ModalPopup.show({
  120. header: Em.I18n.t('installer.navigation.warning.header'),
  121. onPrimary: function () {
  122. App.router.send('gotoStep' + step);
  123. this.hide();
  124. },
  125. body: "If you proceed to go back to Step " + step + ", you will lose any changes you have made beyond this step"
  126. });
  127. } else {
  128. App.router.send('gotoStep' + step);
  129. }
  130. return true;
  131. },
  132. gotoStep0: function () {
  133. this.gotoStep(0);
  134. },
  135. gotoStep1: function () {
  136. this.gotoStep(1);
  137. },
  138. gotoStep2: function () {
  139. this.gotoStep(2);
  140. },
  141. gotoStep3: function () {
  142. this.gotoStep(3);
  143. },
  144. gotoStep4: function () {
  145. this.gotoStep(4);
  146. },
  147. gotoStep5: function () {
  148. this.gotoStep(5);
  149. },
  150. gotoStep6: function () {
  151. this.gotoStep(6);
  152. },
  153. gotoStep7: function () {
  154. this.gotoStep(7);
  155. },
  156. gotoStep8: function () {
  157. this.gotoStep(8);
  158. },
  159. gotoStep9: function () {
  160. this.gotoStep(9);
  161. },
  162. gotoStep10: function () {
  163. this.gotoStep(10);
  164. },
  165. /**
  166. * Initialize host status info for step9
  167. */
  168. setInfoForStep9: function () {
  169. var hostInfo = App.db.getHosts();
  170. for (var index in hostInfo) {
  171. hostInfo[index].status = "pending";
  172. hostInfo[index].message = 'Waiting';
  173. hostInfo[index].logTasks = [];
  174. hostInfo[index].tasks = [];
  175. hostInfo[index].progress = '0';
  176. }
  177. App.db.setHosts(hostInfo);
  178. },
  179. /**
  180. * Remove all data for installOptions step
  181. */
  182. clearInstallOptions: function () {
  183. var installOptions = jQuery.extend({}, this.get('installOptionsTemplate'));
  184. this.set('content.installOptions', installOptions);
  185. this.save('installOptions');
  186. this.set('content.hosts', []);
  187. this.save('hosts');
  188. },
  189. toObject: function (object) {
  190. var result = {};
  191. for (var i in object) {
  192. if (object.hasOwnProperty(i)) {
  193. result[i] = object[i];
  194. }
  195. }
  196. return result;
  197. },
  198. /**
  199. * save status of the cluster. This is called from step8 and step9 to persist install and start requestId
  200. * @param clusterStatus object with status, isCompleted, requestId, isInstallError and isStartError field.
  201. */
  202. saveClusterStatus: function (clusterStatus) {
  203. var oldStatus = this.toObject(this.get('content.cluster'));
  204. clusterStatus = jQuery.extend(oldStatus, clusterStatus);
  205. if (clusterStatus.requestId &&
  206. clusterStatus.oldRequestsId.indexOf(clusterStatus.requestId) === -1) {
  207. clusterStatus.oldRequestsId.push(clusterStatus.requestId);
  208. }
  209. this.set('content.cluster', clusterStatus);
  210. this.save('cluster');
  211. },
  212. /**
  213. * Invoke installation of selected services to the server and saves the request id returned by the server.
  214. * @param isRetry
  215. */
  216. installServices: function (isRetry) {
  217. // clear requests since we are installing services
  218. // and we don't want to get tasks for previous install attempts
  219. this.set('content.cluster.oldRequestsId', []);
  220. var clusterName = this.get('content.cluster.name');
  221. var data;
  222. var name;
  223. if (isRetry) {
  224. name = 'wizard.install_services.installer_controller.is_retry';
  225. data = '{"RequestInfo": {"context" :"' + Em.I18n.t('requestInfo.installComponents') + '"}, "Body": {"HostRoles": {"state": "INSTALLED"}}}';
  226. }
  227. else {
  228. name = 'wizard.install_services.installer_controller.not_is_retry';
  229. data = '{"RequestInfo": {"context" :"' + Em.I18n.t('requestInfo.installServices') + '"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}';
  230. }
  231. App.ajax.send({
  232. name: name,
  233. sender: this,
  234. data: {
  235. data: data,
  236. cluster: clusterName
  237. },
  238. success: 'installServicesSuccessCallback',
  239. error: 'installServicesErrorCallback'
  240. });
  241. },
  242. installServicesSuccessCallback: function (jsonData) {
  243. var installStartTime = new Date().getTime();
  244. console.log("TRACE: In success function for the installService call");
  245. if (jsonData) {
  246. var requestId = jsonData.Requests.id;
  247. console.log('requestId is: ' + requestId);
  248. var clusterStatus = {
  249. status: 'PENDING',
  250. requestId: requestId,
  251. isInstallError: false,
  252. isCompleted: false,
  253. installStartTime: installStartTime
  254. };
  255. this.saveClusterStatus(clusterStatus);
  256. } else {
  257. console.log('ERROR: Error occurred in parsing JSON data');
  258. }
  259. },
  260. installServicesErrorCallback: function (request, ajaxOptions, error) {
  261. console.log("TRACE: In error function for the installService call");
  262. console.log("TRACE: error code status is: " + request.status);
  263. console.log('Error message is: ' + request.responseText);
  264. var clusterStatus = {
  265. status: 'PENDING',
  266. requestId: this.get('content.cluster.requestId'),
  267. isInstallError: true,
  268. isCompleted: false
  269. };
  270. this.saveClusterStatus(clusterStatus);
  271. App.showAlertPopup(Em.I18n.t('common.errorPopup.header'), request.responseText);
  272. },
  273. bootstrapRequestId: null,
  274. /*
  275. Bootstrap selected hosts.
  276. */
  277. launchBootstrap: function (bootStrapData) {
  278. App.ajax.send({
  279. name: 'wizard.launch_bootstrap',
  280. sender: this,
  281. data: {
  282. bootStrapData: bootStrapData
  283. },
  284. success: 'launchBootstrapSuccessCallback',
  285. error: 'launchBootstrapErrorCallback'
  286. });
  287. return this.get('bootstrapRequestId');
  288. },
  289. launchBootstrapSuccessCallback: function (data) {
  290. console.log("TRACE: POST bootstrap succeeded");
  291. this.set('bootstrapRequestId', data.requestId);
  292. },
  293. launchBootstrapErrorCallback: function () {
  294. console.log("ERROR: POST bootstrap failed");
  295. alert('Bootstrap call failed. Please try again.');
  296. },
  297. /**
  298. * Load <code>content.<name></code> variable from localStorage, if wasn't loaded before.
  299. * If you specify <code>reload</code> to true - it will reload it.
  300. * @param name
  301. * @param reload
  302. * @return {Boolean}
  303. */
  304. load: function (name, reload) {
  305. if (this.get('content.' + name) && !reload) {
  306. return false;
  307. }
  308. var result = App.db['get' + name.capitalize()]();
  309. if (!result) {
  310. result = this['get' + name.capitalize()]();
  311. App.db['set' + name.capitalize()](result);
  312. console.log(this.get('name') + ": created " + name, result);
  313. }
  314. this.set('content.' + name, result);
  315. console.log(this.get('name') + ": loaded " + name, result);
  316. },
  317. save: function (name) {
  318. var value = this.toObject(this.get('content.' + name));
  319. App.db['set' + name.capitalize()](value);
  320. console.log(this.get('name') + ": saved " + name, value);
  321. },
  322. clear: function () {
  323. this.set('content', Ember.Object.create({
  324. 'controllerName': this.get('content.controllerName')
  325. }));
  326. this.set('currentStep', 0);
  327. this.clearStorageData();
  328. },
  329. clusterStatusTemplate: {
  330. name: "",
  331. status: "PENDING",
  332. isCompleted: false,
  333. requestId: null,
  334. installStartTime: null,
  335. installTime: null,
  336. isInstallError: false,
  337. isStartError: false,
  338. oldRequestsId: []
  339. },
  340. clearStorageData: function () {
  341. App.db.setService(undefined); //not to use this data at AddService page
  342. App.db.setHosts(undefined);
  343. App.db.setMasterComponentHosts(undefined);
  344. App.db.setSlaveComponentHosts(undefined);
  345. App.db.setCluster(undefined);
  346. App.db.setAllHostNames(undefined);
  347. App.db.setInstallOptions(undefined);
  348. App.db.setAllHostNamesPattern(undefined);
  349. },
  350. installOptionsTemplate: {
  351. hostNames: "", //string
  352. manualInstall: false, //true, false
  353. useSsh: true, //bool
  354. javaHome: App.defaultJavaHome, //string
  355. localRepo: false, //true, false
  356. sshKey: "", //string
  357. bootRequestId: null, //string
  358. sshUser: "root" //string
  359. },
  360. loadedServiceComponents: null,
  361. /**
  362. * Generate serviceComponents as pr the stack definition and save it to localdata
  363. * called form stepController step4WizardController
  364. */
  365. loadServiceComponents: function () {
  366. App.ajax.send({
  367. name: 'wizard.service_components',
  368. sender: this,
  369. data: {
  370. stackUrl: App.get('stack2VersionURL'),
  371. stackVersion: App.get('currentStackVersionNumber')
  372. },
  373. success: 'loadServiceComponentsSuccessCallback',
  374. error: 'loadServiceComponentsErrorCallback'
  375. });
  376. return this.get('loadedServiceComponents');
  377. },
  378. loadServiceComponentsSuccessCallback: function (jsonData) {
  379. var displayOrderConfig = require('data/services');
  380. console.log("TRACE: getService ajax call -> In success function for the getServiceComponents call");
  381. console.log("TRACE: jsonData.services : " + jsonData.items);
  382. // Creating Model
  383. var Service = Ember.Object.extend({
  384. serviceName: null,
  385. displayName: null,
  386. isDisabled: true,
  387. isSelected: true,
  388. isInstalled: false,
  389. description: null,
  390. version: null
  391. });
  392. var data = [];
  393. // loop through all the service components
  394. for (var i = 0; i < displayOrderConfig.length; i++) {
  395. var entry = jsonData.items.findProperty("StackServices.service_name", displayOrderConfig[i].serviceName);
  396. if (entry) {
  397. var myService = Service.create({
  398. serviceName: entry.StackServices.service_name,
  399. displayName: displayOrderConfig[i].displayName,
  400. isDisabled: displayOrderConfig[i].isDisabled,
  401. isSelected: displayOrderConfig[i].isSelected,
  402. canBeSelected: displayOrderConfig[i].canBeSelected,
  403. isInstalled: false,
  404. isHidden: displayOrderConfig[i].isHidden,
  405. description: entry.StackServices.comments,
  406. version: entry.StackServices.service_version
  407. });
  408. data.push(myService);
  409. }
  410. else {
  411. console.warn('Service not found - ', displayOrderConfig[i].serviceName);
  412. }
  413. }
  414. this.set('loadedServiceComponents', data);
  415. console.log('TRACE: service components: ' + JSON.stringify(data));
  416. },
  417. loadServiceComponentsErrorCallback: function (request, ajaxOptions, error) {
  418. console.log("TRACE: STep5 -> In error function for the getServiceComponents call");
  419. console.log("TRACE: STep5 -> error code status is: " + request.status);
  420. console.log('Step8: Error message is: ' + request.responseText);
  421. },
  422. loadServicesFromServer: function () {
  423. var services = App.db.getService();
  424. if (services) {
  425. return;
  426. }
  427. var apiService = this.loadServiceComponents();
  428. this.set('content.services', apiService);
  429. App.db.setService(apiService);
  430. },
  431. registerErrPopup: function (header, message) {
  432. App.ModalPopup.show({
  433. header: header,
  434. secondary: false,
  435. onPrimary: function () {
  436. this.hide();
  437. },
  438. bodyClass: Ember.View.extend({
  439. template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
  440. message: message
  441. })
  442. });
  443. },
  444. /**
  445. * Save hosts that the user confirmed to proceed with from step 3
  446. * @param stepController App.WizardStep3Controller
  447. */
  448. saveConfirmedHosts: function (stepController) {
  449. var hostInfo = {};
  450. stepController.get('content.hosts').forEach(function (_host) {
  451. hostInfo[_host.name] = {
  452. name: _host.name,
  453. cpu: _host.cpu,
  454. memory: _host.memory,
  455. disk_info: _host.disk_info,
  456. bootStatus: _host.bootStatus,
  457. isInstalled: false
  458. };
  459. });
  460. console.log('wizardController:saveConfirmedHosts: save hosts ', hostInfo);
  461. App.db.setHosts(hostInfo);
  462. this.set('content.hosts', hostInfo);
  463. },
  464. /**
  465. * Save data after installation to main controller
  466. * @param stepController App.WizardStep9Controller
  467. */
  468. saveInstalledHosts: function (stepController) {
  469. var hosts = stepController.get('hosts');
  470. var hostInfo = App.db.getHosts();
  471. for (var index in hostInfo) {
  472. hostInfo[index].status = "pending";
  473. var host = hosts.findProperty('name', hostInfo[index].name);
  474. if (host) {
  475. hostInfo[index].status = host.status;
  476. hostInfo[index].message = host.message;
  477. hostInfo[index].progress = host.progress;
  478. }
  479. }
  480. this.set('content.hosts', hostInfo);
  481. this.save('hosts');
  482. console.log('wizardController:saveInstalledHosts: save hosts ', hostInfo);
  483. },
  484. /**
  485. * Save slaveHostComponents to main controller
  486. * @param stepController
  487. */
  488. saveSlaveComponentHosts: function (stepController) {
  489. var hosts = stepController.get('hosts');
  490. var headers = stepController.get('headers');
  491. var formattedHosts = Ember.Object.create();
  492. headers.forEach(function (header) {
  493. formattedHosts.set(header.get('name'), []);
  494. });
  495. hosts.forEach(function (host) {
  496. var checkboxes = host.get('checkboxes');
  497. headers.forEach(function (header) {
  498. var cb = checkboxes.findProperty('title', header.get('label'));
  499. if (cb.get('checked')) {
  500. formattedHosts.get(header.get('name')).push({
  501. hostName: host.hostName,
  502. group: 'Default',
  503. isInstalled: cb.get('isInstalled')
  504. });
  505. }
  506. });
  507. });
  508. var slaveComponentHosts = [];
  509. headers.forEach(function (header) {
  510. slaveComponentHosts.push({
  511. componentName: header.get('name'),
  512. displayName: header.get('label').replace(/\s/g, ''),
  513. hosts: formattedHosts.get(header.get('name'))
  514. });
  515. });
  516. App.db.setSlaveComponentHosts(slaveComponentHosts);
  517. console.log('wizardController.slaveComponentHosts: saved hosts', slaveComponentHosts);
  518. this.set('content.slaveComponentHosts', slaveComponentHosts);
  519. },
  520. /**
  521. * Return true if cluster data is loaded and false otherwise.
  522. * This is used for all wizard controllers except for installer wizard.
  523. */
  524. dataLoading: function () {
  525. var dfd = $.Deferred();
  526. this.connectOutlet('loading');
  527. if (App.router.get('clusterController.isLoaded')) {
  528. dfd.resolve();
  529. } else {
  530. var interval = setInterval(function () {
  531. if (App.router.get('clusterController.isLoaded')) {
  532. dfd.resolve();
  533. clearInterval(interval);
  534. }
  535. }, 50);
  536. }
  537. return dfd.promise();
  538. },
  539. /**
  540. * Return true if user data is loaded via App.MainServiceInfoConfigsController
  541. * This function is used in reassign master wizard right now.
  542. */
  543. usersLoading: function () {
  544. var self = this;
  545. var dfd = $.Deferred();
  546. var miscController = App.MainAdminMiscController.create({content: self.get('content')});
  547. miscController.loadUsers();
  548. var interval = setInterval(function () {
  549. if (miscController.get('dataIsLoaded')) {
  550. if (self.get("content.hdfsUser")) {
  551. self.set('content.hdfsUser', miscController.get('content.hdfsUser'));
  552. }
  553. dfd.resolve();
  554. clearInterval(interval);
  555. }
  556. }, 10);
  557. return dfd.promise();
  558. },
  559. /**
  560. * Save cluster status before going to deploy step
  561. * @param name cluster state. Unique for every wizard
  562. */
  563. saveClusterState: function (name) {
  564. App.clusterStatus.setClusterStatus({
  565. clusterName: this.get('content.cluster.name'),
  566. clusterState: name,
  567. wizardControllerName: this.get('content.controllerName'),
  568. localdb: App.db.data
  569. });
  570. },
  571. /**
  572. * load advanced configs from server
  573. */
  574. loadAdvancedConfigs: function () {
  575. var configs = (App.db.getAdvancedServiceConfig()) ? App.db.getAdvancedServiceConfig() : [];
  576. this.get('content.services').filterProperty('isSelected', true).mapProperty('serviceName').forEach(function (_serviceName) {
  577. var serviceComponents = App.config.loadAdvancedConfig(_serviceName);
  578. if (serviceComponents) {
  579. configs = configs.concat(serviceComponents);
  580. }
  581. }, this);
  582. this.set('content.advancedServiceConfig', configs);
  583. App.db.setAdvancedServiceConfig(configs);
  584. },
  585. /**
  586. * Load serviceConfigProperties to model
  587. */
  588. loadServiceConfigProperties: function () {
  589. var serviceConfigProperties = App.db.getServiceConfigProperties();
  590. this.set('content.serviceConfigProperties', serviceConfigProperties);
  591. console.log("AddHostController.loadServiceConfigProperties: loaded config ", serviceConfigProperties);
  592. },
  593. /**
  594. * Save config properties
  595. * @param stepController Step7WizardController
  596. */
  597. saveServiceConfigProperties: function (stepController) {
  598. var serviceConfigProperties = [];
  599. stepController.get('stepConfigs').forEach(function (_content) {
  600. if (_content.serviceName === 'YARN' && !App.supports.capacitySchedulerUi) {
  601. _content.set('configs', App.config.textareaIntoFileConfigs(_content.get('configs'), 'capacity-scheduler.xml'));
  602. }
  603. _content.get('configs').forEach(function (_configProperties) {
  604. var overrides = _configProperties.get('overrides');
  605. var overridesArray = [];
  606. if (overrides != null) {
  607. overrides.forEach(function (override) {
  608. var overrideEntry = {
  609. value: override.get('value'),
  610. hosts: []
  611. };
  612. override.get('selectedHostOptions').forEach(function (host) {
  613. overrideEntry.hosts.push(host);
  614. });
  615. overridesArray.push(overrideEntry);
  616. });
  617. }
  618. overridesArray = (overridesArray.length) ? overridesArray : null;
  619. var configProperty = {
  620. id: _configProperties.get('id'),
  621. name: _configProperties.get('name'),
  622. value: _configProperties.get('value'),
  623. defaultValue: _configProperties.get('defaultValue'),
  624. description: _configProperties.get('description'),
  625. serviceName: _configProperties.get('serviceName'),
  626. domain: _configProperties.get('domain'),
  627. filename: _configProperties.get('filename'),
  628. displayType: _configProperties.get('displayType'),
  629. overrides: overridesArray
  630. };
  631. serviceConfigProperties.push(configProperty);
  632. }, this);
  633. }, this);
  634. App.db.setServiceConfigProperties(serviceConfigProperties);
  635. this.set('content.serviceConfigProperties', serviceConfigProperties);
  636. }
  637. });