wizard.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  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.isStepDisabled.pushObject(Ember.Object.create({
  25. step: 1,
  26. value: false
  27. }));
  28. for (var i = 2; i <= this.get('totalSteps'); i++) {
  29. this.isStepDisabled.pushObject(Ember.Object.create({
  30. step: i,
  31. value: true
  32. }));
  33. }
  34. // window.onbeforeunload = function () {
  35. // return "You have not saved your document yet. If you continue, your work will not be saved."
  36. //}
  37. },
  38. setStepsEnable: function () {
  39. for (var i = 1; i <= this.totalSteps; i++) {
  40. var step = this.get('isStepDisabled').findProperty('step', i);
  41. if (i <= this.get('currentStep')) {
  42. step.set('value', false);
  43. } else {
  44. step.set('value', true);
  45. }
  46. }
  47. }.observes('currentStep'),
  48. setLowerStepsDisable: function (stepNo) {
  49. for (var i = 1; i < stepNo; i++) {
  50. var step = this.get('isStepDisabled').findProperty('step', i);
  51. step.set('value', true);
  52. }
  53. },
  54. /**
  55. * Set current step to new value.
  56. * Method moved from App.router.setInstallerCurrentStep
  57. * @param currentStep
  58. * @param completed
  59. */
  60. currentStep: function () {
  61. return App.get('router').getWizardCurrentStep(this.get('name').substr(0, this.get('name').length - 10));
  62. }.property(),
  63. /**
  64. * Set current step to new value.
  65. * Method moved from App.router.setInstallerCurrentStep
  66. * @param currentStep
  67. * @param completed
  68. */
  69. setCurrentStep: function (currentStep, completed) {
  70. App.db.setWizardCurrentStep(this.get('name').substr(0, this.get('name').length - 10), currentStep, completed);
  71. this.set('currentStep', currentStep);
  72. },
  73. clusters: null,
  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;
  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. },
  131. gotoStep1: function () {
  132. this.gotoStep(1);
  133. },
  134. gotoStep2: function () {
  135. this.gotoStep(2);
  136. },
  137. gotoStep3: function () {
  138. this.gotoStep(3);
  139. },
  140. gotoStep4: function () {
  141. this.gotoStep(4);
  142. },
  143. gotoStep5: function () {
  144. this.gotoStep(5);
  145. },
  146. gotoStep6: function () {
  147. this.gotoStep(6);
  148. },
  149. gotoStep7: function () {
  150. this.gotoStep(7);
  151. },
  152. gotoStep8: function () {
  153. this.gotoStep(8);
  154. },
  155. gotoStep9: function () {
  156. this.gotoStep(9);
  157. },
  158. gotoStep10: function () {
  159. this.gotoStep(10);
  160. },
  161. /**
  162. * Initialize host status info for step9
  163. */
  164. setInfoForStep9: function () {
  165. var hostInfo = App.db.getHosts();
  166. for (var index in hostInfo) {
  167. hostInfo[index].status = "pending";
  168. hostInfo[index].message = 'Waiting';
  169. hostInfo[index].logTasks = [];
  170. hostInfo[index].tasks = [];
  171. hostInfo[index].progress = '0';
  172. }
  173. App.db.setHosts(hostInfo);
  174. },
  175. /**
  176. * Remove all data for installOptions step
  177. */
  178. clearInstallOptions: function () {
  179. var installOptions = jQuery.extend({}, this.get('installOptionsTemplate'));
  180. this.set('content.installOptions', installOptions);
  181. this.save('installOptions');
  182. this.set('content.hosts', []);
  183. this.save('hosts');
  184. },
  185. toObject: function(object){
  186. var result = {};
  187. for(var i in object){
  188. if(object.hasOwnProperty(i)){
  189. result[i] = object[i];
  190. }
  191. }
  192. return result;
  193. },
  194. /**
  195. * save status of the cluster. This is called from step8 and step9 to persist install and start requestId
  196. * @param clusterStatus object with status, isCompleted, requestId, isInstallError and isStartError field.
  197. */
  198. saveClusterStatus: function (clusterStatus) {
  199. var oldStatus = this.toObject(this.get('content.cluster'));
  200. clusterStatus = jQuery.extend(oldStatus, clusterStatus);
  201. if (clusterStatus.requestId &&
  202. clusterStatus.oldRequestsId.indexOf(clusterStatus.requestId) === -1){
  203. clusterStatus.oldRequestsId.push(clusterStatus.requestId);
  204. }
  205. this.set('content.cluster', clusterStatus);
  206. this.save('cluster');
  207. },
  208. /**
  209. * Invoke installation of selected services to the server and saves the request id returned by the server.
  210. * @param isRetry
  211. */
  212. installServices: function (isRetry) {
  213. // clear requests since we are installing services
  214. // and we don't want to get tasks for previous install attempts
  215. this.set('content.cluster.oldRequestsId', []);
  216. this.set('content.cluster.requestId', null);
  217. var self = this;
  218. var clusterName = this.get('content.cluster.name');
  219. var url;
  220. var method = (App.testMode) ? 'GET' : 'PUT';
  221. var data;
  222. switch (this.get('content.controllerName')) {
  223. case 'addHostController':
  224. if (isRetry) {
  225. url = App.apiPrefix + '/clusters/' + clusterName + '/host_components?HostRoles/state=INSTALLED';
  226. } else {
  227. url = App.apiPrefix + '/clusters/' + clusterName + '/host_components?HostRoles/state=INIT';
  228. }
  229. data = '{"RequestInfo": {"context" :"'+ Em.I18n.t('requestInfo.installComponents') +'"}, "Body": {"HostRoles": {"state": "INSTALLED"}}}';
  230. break;
  231. case 'installerController':
  232. default:
  233. if (isRetry) {
  234. url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + clusterName + '/host_components?HostRoles/state!=INSTALLED';
  235. data = '{"RequestInfo": {"context" :"'+ Em.I18n.t('requestInfo.installComponents') +'"}, "Body": {"HostRoles": {"state": "INSTALLED"}}}';
  236. } else {
  237. url = (App.testMode) ? '/data/wizard/deploy/2_hosts/poll_1.json' : App.apiPrefix + '/clusters/' + clusterName + '/services?ServiceInfo/state=INIT';
  238. data = '{"RequestInfo": {"context" :"'+ Em.I18n.t('requestInfo.installServices') +'"}, "Body": {"ServiceInfo": {"state": "INSTALLED"}}}';
  239. }
  240. break;
  241. }
  242. $.ajax({
  243. type: method,
  244. url: url,
  245. data: data,
  246. async: false,
  247. dataType: 'text',
  248. timeout: App.timeout,
  249. success: function (data) {
  250. var jsonData = jQuery.parseJSON(data);
  251. var installStartTime = new Date().getTime();
  252. console.log("TRACE: In success function for the installService call");
  253. console.log("TRACE: value of the url is: " + url);
  254. if (jsonData) {
  255. var requestId = jsonData.Requests.id;
  256. console.log('requestId is: ' + requestId);
  257. var clusterStatus = {
  258. status: 'PENDING',
  259. requestId: requestId,
  260. isInstallError: false,
  261. isCompleted: false,
  262. installStartTime: installStartTime
  263. };
  264. self.saveClusterStatus(clusterStatus);
  265. } else {
  266. console.log('ERROR: Error occurred in parsing JSON data');
  267. }
  268. },
  269. error: function (request, ajaxOptions, error) {
  270. console.log("TRACE: In error function for the installService call");
  271. console.log("TRACE: value of the url is: " + url);
  272. console.log("TRACE: error code status is: " + request.status);
  273. console.log('Error message is: ' + request.responseText);
  274. var clusterStatus = {
  275. status: 'PENDING',
  276. isInstallError: false,
  277. isCompleted: false
  278. };
  279. self.saveClusterStatus(clusterStatus);
  280. },
  281. statusCode: require('data/statusCodes')
  282. });
  283. },
  284. /*
  285. Bootstrap selected hosts.
  286. */
  287. launchBootstrap: function (bootStrapData) {
  288. var self = this;
  289. var requestId = null;
  290. var method = App.testMode ? 'GET' : 'POST';
  291. var url = App.testMode ? '/data/wizard/bootstrap/bootstrap.json' : App.apiPrefix + '/bootstrap';
  292. $.ajax({
  293. type: method,
  294. url: url,
  295. async: false,
  296. data: bootStrapData,
  297. timeout: App.timeout,
  298. contentType: 'application/json',
  299. success: function (data) {
  300. console.log("TRACE: POST bootstrap succeeded");
  301. requestId = data.requestId;
  302. },
  303. error: function () {
  304. console.log("ERROR: POST bootstrap failed");
  305. alert('Bootstrap call failed. Please try again.');
  306. },
  307. statusCode: require('data/statusCodes')
  308. });
  309. return requestId;
  310. },
  311. /**
  312. * Load <code>content.<name></code> variable from localStorage, if wasn't loaded before.
  313. * If you specify <code>reload</code> to true - it will reload it.
  314. * @param name
  315. * @param reload
  316. * @return {Boolean}
  317. */
  318. load: function (name, reload) {
  319. if (this.get('content.' + name) && !reload) {
  320. return false;
  321. }
  322. var result = App.db['get' + name.capitalize()]();
  323. if (!result){
  324. result = this['get' + name.capitalize()]();
  325. App.db['set' + name.capitalize()](result);
  326. console.log(this.get('name') + ": created " + name, result);
  327. }
  328. this.set('content.' + name, result);
  329. console.log(this.get('name') + ": loaded " + name, result);
  330. },
  331. save: function(name){
  332. var value = this.toObject(this.get('content.' + name));
  333. App.db['set' + name.capitalize()](value);
  334. console.log(this.get('name') + ": saved " + name, value);
  335. },
  336. clear: function () {
  337. this.set('content', Ember.Object.create({
  338. 'controllerName': this.get('content.controllerName')
  339. }));
  340. this.set('currentStep', 0);
  341. this.clearStorageData();
  342. },
  343. clusterStatusTemplate : {
  344. name: "",
  345. status: "PENDING",
  346. isCompleted: false,
  347. requestId: null,
  348. installStartTime: null,
  349. installTime: null,
  350. isInstallError: false,
  351. isStartError: false,
  352. oldRequestsId: []
  353. },
  354. clearStorageData: function(){
  355. App.db.setService(undefined); //not to use this data at AddService page
  356. App.db.setHosts(undefined);
  357. App.db.setMasterComponentHosts(undefined);
  358. App.db.setSlaveComponentHosts(undefined);
  359. App.db.setCluster(undefined);
  360. App.db.setAllHostNames(undefined);
  361. App.db.setSlaveProperties(undefined);
  362. App.db.setInstallOptions(undefined);
  363. App.db.setAllHostNamesPattern(undefined);
  364. },
  365. installOptionsTemplate: {
  366. hostNames: "", //string
  367. manualInstall: false, //true, false
  368. useSsh: true, //bool
  369. isJavaHome : false, //bool
  370. javaHome: App.defaultJavaHome, //string
  371. localRepo: false, //true, false
  372. sshKey: "", //string
  373. bootRequestId: null //string
  374. },
  375. /**
  376. * Generate serviceComponents as pr the stack definition and save it to localdata
  377. * called form stepController step4WizardController
  378. */
  379. loadServiceComponents: function (displayOrderConfig, apiUrl) {
  380. var result = null;
  381. var method = 'GET';
  382. var testUrl = '/data/wizard/stack/hdp/version/1.3.0.json';
  383. var url = (App.testMode) ? testUrl : App.apiPrefix + apiUrl;
  384. $.ajax({
  385. type: method,
  386. url: url,
  387. async: false,
  388. dataType: 'text',
  389. timeout: App.timeout,
  390. success: function (data) {
  391. var jsonData = jQuery.parseJSON(data);
  392. console.log("TRACE: getService ajax call -> In success function for the getServiceComponents call");
  393. console.log("TRACE: jsonData.services : " + jsonData.services);
  394. // Creating Model
  395. var Service = Ember.Object.extend({
  396. serviceName: null,
  397. displayName: null,
  398. isDisabled: true,
  399. isSelected: true,
  400. isInstalled: false,
  401. description: null,
  402. version: null
  403. });
  404. var data = [];
  405. // loop through all the service components
  406. for (var i = 0; i < displayOrderConfig.length; i++) {
  407. var entry = jsonData.services.findProperty("name", displayOrderConfig[i].serviceName);
  408. if (entry) {
  409. var myService = Service.create({
  410. serviceName: entry.name,
  411. displayName: displayOrderConfig[i].displayName,
  412. isDisabled: i === 0,
  413. isSelected: true,
  414. isInstalled: false,
  415. isHidden: displayOrderConfig[i].isHidden,
  416. description: entry.comment,
  417. version: entry.version
  418. });
  419. data.push(myService);
  420. }
  421. else {
  422. console.warn('Service not found - ', displayOrderConfig[i].serviceName);
  423. }
  424. }
  425. result = data;
  426. console.log('TRACE: service components: ' + JSON.stringify(data));
  427. },
  428. error: function (request, ajaxOptions, error) {
  429. console.log("TRACE: STep5 -> In error function for the getServiceComponents call");
  430. console.log("TRACE: STep5 -> value of the url is: " + url);
  431. console.log("TRACE: STep5 -> error code status is: " + request.status);
  432. console.log('Step8: Error message is: ' + request.responseText);
  433. },
  434. statusCode: require('data/statusCodes')
  435. });
  436. return result;
  437. },
  438. loadServicesFromServer: function() {
  439. var services = App.db.getService();
  440. if (services) {
  441. return;
  442. }
  443. var displayOrderConfig = require('data/services');
  444. var apiUrl = App.get('stackVersionURL');
  445. var apiService = this.loadServiceComponents(displayOrderConfig, apiUrl);
  446. this.set('content.services', apiService);
  447. App.db.setService(apiService);
  448. },
  449. registerErrPopup: function (header, message) {
  450. App.ModalPopup.show({
  451. header: header,
  452. secondary: false,
  453. onPrimary: function () {
  454. this.hide();
  455. },
  456. bodyClass: Ember.View.extend({
  457. template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
  458. message: message
  459. })
  460. });
  461. },
  462. /**
  463. * Save hosts that the user confirmed to proceed with from step 3
  464. * @param stepController App.WizardStep3Controller
  465. */
  466. saveConfirmedHosts: function (stepController) {
  467. var hostInfo = {};
  468. stepController.get('content.hosts').forEach(function (_host) {
  469. hostInfo[_host.name] = {
  470. name: _host.name,
  471. cpu: _host.cpu,
  472. memory: _host.memory,
  473. disk_info: _host.disk_info,
  474. bootStatus: _host.bootStatus,
  475. isInstalled: false
  476. };
  477. });
  478. console.log('wizardController:saveConfirmedHosts: save hosts ', hostInfo);
  479. App.db.setHosts(hostInfo);
  480. this.set('content.hosts', hostInfo);
  481. },
  482. /**
  483. * Save data after installation to main controller
  484. * @param stepController App.WizardStep9Controller
  485. */
  486. saveInstalledHosts: function (stepController) {
  487. var hosts = stepController.get('hosts');
  488. var hostInfo = App.db.getHosts();
  489. for (var index in hostInfo) {
  490. hostInfo[index].status = "pending";
  491. var host = hosts.findProperty('name', hostInfo[index].name);
  492. if (host) {
  493. hostInfo[index].status = host.status;
  494. hostInfo[index].message = host.message;
  495. hostInfo[index].progress = host.progress;
  496. }
  497. }
  498. this.set('content.hosts', hostInfo);
  499. this.save('hosts');
  500. console.log('wizardController:saveInstalledHosts: save hosts ', hostInfo);
  501. },
  502. /**
  503. * Save slaveHostComponents to main controller
  504. * @param stepController
  505. */
  506. saveSlaveComponentHosts: function (stepController) {
  507. var hosts = stepController.get('hosts');
  508. var headers = stepController.get('headers');
  509. var formattedHosts = Ember.Object.create();
  510. headers.forEach(function(header) {
  511. formattedHosts.set(header.get('name'), []);
  512. });
  513. hosts.forEach(function (host) {
  514. var checkboxes = host.get('checkboxes');
  515. headers.forEach(function(header) {
  516. var cb = checkboxes.findProperty('title', header.get('label'));
  517. if (cb.get('checked')) {
  518. formattedHosts.get(header.get('name')).push({
  519. hostName: host.hostName,
  520. group: 'Default',
  521. isInstalled: cb.get('isInstalled')
  522. });
  523. }
  524. });
  525. });
  526. var slaveComponentHosts = [];
  527. headers.forEach(function(header) {
  528. slaveComponentHosts.push({
  529. componentName: header.get('name'),
  530. displayName: header.get('label').replace(/\s/g, ''),
  531. hosts: formattedHosts.get(header.get('name'))
  532. });
  533. });
  534. App.db.setSlaveComponentHosts(slaveComponentHosts);
  535. console.log('wizardController.slaveComponentHosts: saved hosts', slaveComponentHosts);
  536. this.set('content.slaveComponentHosts', slaveComponentHosts);
  537. },
  538. /**
  539. * Return true if cluster data is loaded and false otherwise.
  540. * This is used for all wizard controllers except for installer wizard.
  541. */
  542. dataLoading: function(){
  543. var dfd = $.Deferred();
  544. this.connectOutlet('loading');
  545. if (App.router.get('clusterController.isLoaded')){
  546. dfd.resolve();
  547. } else{
  548. var interval = setInterval(function(){
  549. if (App.router.get('clusterController.isLoaded')){
  550. dfd.resolve();
  551. clearInterval(interval);
  552. }
  553. },50);
  554. }
  555. return dfd.promise();
  556. },
  557. /**
  558. * Save cluster status before going to deploy step
  559. * @param name cluster state. Unique for every wizard
  560. */
  561. saveClusterState: function(name){
  562. App.clusterStatus.setClusterStatus({
  563. clusterName: this.get('content.cluster.name'),
  564. clusterState: name,
  565. wizardControllerName: this.get('content.controllerName'),
  566. localdb: App.db.data
  567. });
  568. },
  569. /**
  570. * load advanced configs from server
  571. */
  572. loadAdvancedConfigs: function () {
  573. var configs = (App.db.getAdvancedServiceConfig()) ? App.db.getAdvancedServiceConfig() : [];
  574. this.get('content.services').filterProperty('isSelected', true).mapProperty('serviceName').forEach(function (_serviceName) {
  575. var serviceComponents = App.config.loadAdvancedConfig(_serviceName);
  576. if(serviceComponents){
  577. configs = configs.concat(serviceComponents);
  578. }
  579. }, this);
  580. this.set('content.advancedServiceConfig', configs);
  581. App.db.setAdvancedServiceConfig(configs);
  582. },
  583. /**
  584. * Load serviceConfigProperties to model
  585. */
  586. loadServiceConfigProperties: function () {
  587. var serviceConfigProperties = App.db.getServiceConfigProperties();
  588. this.set('content.serviceConfigProperties', serviceConfigProperties);
  589. console.log("AddHostController.loadServiceConfigProperties: loaded config ", serviceConfigProperties);
  590. },
  591. /**
  592. * Save config properties
  593. * @param stepController Step7WizardController
  594. */
  595. saveServiceConfigProperties: function (stepController) {
  596. var serviceConfigProperties = [];
  597. stepController.get('stepConfigs').forEach(function (_content) {
  598. _content.get('configs').forEach(function (_configProperties) {
  599. var displayType = _configProperties.get('displayType');
  600. if (displayType === 'directories' || displayType === 'directory') {
  601. var value = _configProperties.get('value').trim().split(/\s+/g).join(',');
  602. _configProperties.set('value', value);
  603. }
  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. var configProperty = {
  619. id: _configProperties.get('id'),
  620. name: _configProperties.get('name'),
  621. value: _configProperties.get('value'),
  622. defaultValue: _configProperties.get('defaultValue'),
  623. serviceName: _configProperties.get('serviceName'),
  624. domain: _configProperties.get('domain'),
  625. filename: _configProperties.get('filename')
  626. };
  627. serviceConfigProperties.push(configProperty);
  628. }, this);
  629. }, this);
  630. App.db.setServiceConfigProperties(serviceConfigProperties);
  631. this.set('content.serviceConfigProperties', serviceConfigProperties);
  632. }
  633. })