step3_controller.js 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173
  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.WizardStep3Controller = Em.Controller.extend({
  20. name: 'wizardStep3Controller',
  21. hosts: [],
  22. content: [],
  23. bootHosts: [],
  24. registeredHosts: [],
  25. registrationStartedAt: null,
  26. registrationTimeoutSecs: function(){
  27. if(this.get('content.installOptions.manualInstall')){
  28. return 15;
  29. }
  30. return 120;
  31. }.property('content.installOptions.manualInstall'),
  32. stopBootstrap: false,
  33. isSubmitDisabled: true,
  34. categoryObject: Em.Object.extend({
  35. hostsCount: function () {
  36. var category = this;
  37. var hosts = this.get('controller.hosts').filter(function(_host) {
  38. if (_host.get('bootStatus') == category.get('hostsBootStatus')) {
  39. return true;
  40. } else if (_host.get('bootStatus') == 'DONE' && category.get('hostsBootStatus') == 'REGISTERING') {
  41. return true;
  42. } else {
  43. return false;
  44. }
  45. }, this);
  46. return hosts.get('length');
  47. }.property('controller.hosts.@each.bootStatus'), // 'hosts.@each.bootStatus'
  48. label: function () {
  49. return "%@ (%@)".fmt(this.get('value'), this.get('hostsCount'));
  50. }.property('value', 'hostsCount')
  51. }),
  52. getCategory: function(field, value){
  53. return this.get('categories').find(function(item){
  54. return item.get(field) == value;
  55. });
  56. },
  57. categories: function () {
  58. var self = this;
  59. self.categoryObject.reopen({
  60. controller: self,
  61. isActive: function(){
  62. return this.get('controller.category') == this;
  63. }.property('controller.category'),
  64. itemClass: function(){
  65. return this.get('isActive') ? 'active' : '';
  66. }.property('isActive')
  67. });
  68. var categories = [
  69. self.categoryObject.create({value: Em.I18n.t('common.all'), hostsCount: function () {
  70. return this.get('controller.hosts.length');
  71. }.property('controller.hosts.length') }),
  72. self.categoryObject.create({value: Em.I18n.t('installer.step3.hosts.status.installing'), hostsBootStatus: 'RUNNING'}),
  73. self.categoryObject.create({value: Em.I18n.t('installer.step3.hosts.status.registering'), hostsBootStatus: 'REGISTERING'}),
  74. self.categoryObject.create({value: Em.I18n.t('common.success'), hostsBootStatus: 'REGISTERED' }),
  75. self.categoryObject.create({value: Em.I18n.t('common.fail'), hostsBootStatus: 'FAILED', last: true })
  76. ];
  77. this.set('category', categories.get('firstObject'));
  78. return categories;
  79. }.property(),
  80. category: false,
  81. allChecked: false,
  82. onAllChecked: function () {
  83. var hosts = this.get('visibleHosts');
  84. hosts.setEach('isChecked', this.get('allChecked'));
  85. }.observes('allChecked'),
  86. noHostsSelected: function () {
  87. return !(this.hosts.someProperty('isChecked', true));
  88. }.property('hosts.@each.isChecked'),
  89. isRetryDisabled: true,
  90. navigateStep: function () {
  91. this.loadStep();
  92. if (this.get('content.installOptions.manualInstall') !== true) {
  93. if (!App.db.getBootStatus()) {
  94. this.startBootstrap();
  95. }
  96. } else {
  97. this.set('bootHosts', this.get('hosts'));
  98. if (App.testMode) {
  99. this.getHostInfo();
  100. this.get('bootHosts').setEach('bootStatus', 'REGISTERED');
  101. this.get('bootHosts').setEach('cpu', '2');
  102. this.get('bootHosts').setEach('memory', '2000000');
  103. this.set('isSubmitDisabled', false);
  104. } else {
  105. this.set('registrationStartedAt', null);
  106. this.get('bootHosts').setEach('bootStatus', 'DONE');
  107. this.startRegistration();
  108. }
  109. }
  110. },
  111. clearStep: function () {
  112. this.set('stopBootstrap', false);
  113. this.hosts.clear();
  114. this.bootHosts.clear();
  115. App.db.setBootStatus(false);
  116. this.set('isSubmitDisabled', true);
  117. this.set('isRetryDisabled', true);
  118. },
  119. loadStep: function () {
  120. console.log("TRACE: Loading step3: Confirm Hosts");
  121. this.set('registrationStartedAt', null);
  122. this.clearStep();
  123. var hosts = this.loadHosts();
  124. // hosts.setEach('bootStatus', 'RUNNING');
  125. this.renderHosts(hosts);
  126. },
  127. /* Loads the hostinfo from localStorage on the insertion of view. It's being called from view */
  128. loadHosts: function () {
  129. var hostInfo = this.get('content.hosts');
  130. var hosts = new Ember.Set();
  131. for (var index in hostInfo) {
  132. hosts.add(hostInfo[index]);
  133. console.log("TRACE: host name is: " + hostInfo[index].name);
  134. }
  135. return hosts;
  136. },
  137. /* Renders the set of passed hosts */
  138. renderHosts: function (hostsInfo) {
  139. var self = this;
  140. hostsInfo.forEach(function (_hostInfo) {
  141. var hostInfo = App.HostInfo.create({
  142. name: _hostInfo.name,
  143. bootStatus: _hostInfo.bootStatus,
  144. isChecked: false
  145. });
  146. console.log('pushing ' + hostInfo.name);
  147. self.hosts.pushObject(hostInfo);
  148. });
  149. },
  150. /**
  151. * Parses and updates the content based on bootstrap API response.
  152. * Returns true if polling should continue (some hosts are in "RUNNING" state); false otherwise
  153. */
  154. parseHostInfo: function (hostsStatusFromServer) {
  155. hostsStatusFromServer.forEach(function (_hostStatus) {
  156. var host = this.get('bootHosts').findProperty('name', _hostStatus.hostName);
  157. // check if hostname extracted from REST API data matches any hostname in content
  158. // also, make sure that bootStatus modified by isHostsRegistered call does not get overwritten
  159. // since these calls are being made in parallel
  160. if (host && !['REGISTERED', 'REGISTERING'].contains(host.get('bootStatus'))) {
  161. host.set('bootStatus', _hostStatus.status);
  162. host.set('bootLog', _hostStatus.log);
  163. }
  164. }, this);
  165. // if the data rendered by REST API has hosts in "RUNNING" state, polling will continue
  166. return this.get('bootHosts').length != 0 && this.get('bootHosts').someProperty('bootStatus', 'RUNNING');
  167. },
  168. /* Returns the current set of visible hosts on view (All, Succeeded, Failed) */
  169. visibleHosts: function () {
  170. var self = this;
  171. if (this.get('category.hostsBootStatus')) {
  172. return this.hosts.filterProperty('bootStatus', self.get('category.hostsBootStatus'));
  173. } else { // if (this.get('category') === 'All Hosts')
  174. return this.hosts;
  175. }
  176. }.property('category', 'hosts.@each.bootStatus'),
  177. removeHosts: function (hosts) {
  178. var self = this;
  179. App.showConfirmationPopup(function() {
  180. App.router.send('removeHosts', hosts);
  181. self.hosts.removeObjects(hosts);
  182. if (!self.hosts.length) {
  183. self.set('isSubmitDisabled', true);
  184. }
  185. },Em.I18n.t('installer.step3.hosts.remove.popup.body'));
  186. },
  187. /* Removes a single element on the trash icon click. Called from View */
  188. removeHost: function (hostInfo) {
  189. this.removeHosts([hostInfo]);
  190. },
  191. removeSelectedHosts: function () {
  192. if (!this.get('noHostsSelected')) {
  193. var selectedHosts = this.get('visibleHosts').filterProperty('isChecked', true);
  194. selectedHosts.forEach(function (_hostInfo) {
  195. console.log('Removing: ' + _hostInfo.name);
  196. });
  197. this.removeHosts(selectedHosts);
  198. }
  199. },
  200. retryHost: function (hostInfo) {
  201. this.retryHosts([hostInfo]);
  202. },
  203. retryHosts: function (hosts) {
  204. var bootStrapData = JSON.stringify({'verbose': true, 'sshKey': this.get('content.installOptions.sshKey'), 'hosts': hosts.mapProperty('name'), 'user': this.get('content.installOptions.sshUser')});
  205. this.numPolls = 0;
  206. if (this.get('content.installOptions.manualInstall') !== true) {
  207. var requestId = App.router.get('installerController').launchBootstrap(bootStrapData);
  208. this.set('content.installOptions.bootRequestId', requestId);
  209. this.set('registrationStartedAt', null);
  210. this.doBootstrap();
  211. } else {
  212. this.set('registrationStartedAt', null);
  213. this.get('bootHosts').setEach('bootStatus', 'DONE');
  214. this.startRegistration();
  215. }
  216. },
  217. retrySelectedHosts: function () {
  218. //to display all hosts
  219. this.set('category', 'All');
  220. if (!this.get('isRetryDisabled')) {
  221. this.set('isRetryDisabled', true);
  222. var selectedHosts = this.get('bootHosts').filterProperty('bootStatus', 'FAILED');
  223. selectedHosts.forEach(function (_host) {
  224. _host.set('bootStatus', 'RUNNING');
  225. _host.set('bootLog', 'Retrying ...');
  226. }, this);
  227. this.retryHosts(selectedHosts);
  228. }
  229. },
  230. numPolls: 0,
  231. startBootstrap: function () {
  232. //this.set('isSubmitDisabled', true); //TODO: uncomment after actual hookup
  233. this.numPolls = 0;
  234. this.set('registrationStartedAt', null);
  235. this.set('bootHosts', this.get('hosts'));
  236. this.get('bootHosts').setEach('bootStatus', 'PENDING');
  237. this.doBootstrap();
  238. },
  239. isInstallInProgress: function(){
  240. var bootStatuses = this.get('bootHosts').getEach('bootStatus');
  241. if(bootStatuses.length &&
  242. (bootStatuses.contains('REGISTERING') ||
  243. bootStatuses.contains('DONE') ||
  244. bootStatuses.contains('RUNNING') ||
  245. bootStatuses.contains('PENDING'))){
  246. return true;
  247. }
  248. return false;
  249. }.property('bootHosts.@each.bootStatus'),
  250. disablePreviousSteps: function(){
  251. if(this.get('isInstallInProgress')){
  252. App.router.get('installerController').setLowerStepsDisable(3);
  253. this.set('isSubmitDisabled', true);
  254. } else {
  255. App.router.get('installerController.isStepDisabled').filter(function(step){
  256. if(step.step >= 0 && step.step <= 2) return true;
  257. }).setEach('value', false);
  258. }
  259. }.observes('isInstallInProgress'),
  260. doBootstrap: function () {
  261. if (this.get('stopBootstrap')) {
  262. return;
  263. }
  264. this.numPolls++;
  265. App.ajax.send({
  266. name: 'wizard.step3.bootstrap',
  267. sender: this,
  268. data: {
  269. bootRequestId: this.get('content.installOptions.bootRequestId'),
  270. numPolls: this.numPolls
  271. },
  272. success: 'doBootstrapSuccessCallback'
  273. }).
  274. retry({
  275. times: App.maxRetries,
  276. timeout: App.timeout
  277. }).
  278. then(
  279. null,
  280. function () {
  281. App.showReloadPopup();
  282. console.log('Bootstrap failed');
  283. }
  284. );
  285. },
  286. doBootstrapSuccessCallback: function (data) {
  287. if (data.hostsStatus !== null) {
  288. // in case of bootstrapping just one host, the server returns an object rather than an array, so
  289. // force into an array
  290. if (!(data.hostsStatus instanceof Array)) {
  291. data.hostsStatus = [ data.hostsStatus ];
  292. }
  293. console.log("TRACE: In success function for the GET bootstrap call");
  294. var keepPolling = this.parseHostInfo(data.hostsStatus);
  295. // Single host : if the only hostname is invalid (data.status == 'ERROR')
  296. // Multiple hosts : if one or more hostnames are invalid
  297. // following check will mark the bootStatus as 'FAILED' for the invalid hostname
  298. if (data.status == 'ERROR' || data.hostsStatus.length != this.get('bootHosts').length) {
  299. var hosts = this.get('bootHosts');
  300. for (var i = 0; i < hosts.length; i++) {
  301. var isValidHost = data.hostsStatus.someProperty('hostName', hosts[i].get('name'));
  302. if(hosts[i].get('bootStatus') !== 'REGISTERED'){
  303. if (!isValidHost) {
  304. hosts[i].set('bootStatus', 'FAILED');
  305. hosts[i].set('bootLog', Em.I18n.t('installer.step3.hosts.bootLog.failed'));
  306. }
  307. }
  308. }
  309. }
  310. if (data.hostsStatus.someProperty('status', 'DONE') || data.hostsStatus.someProperty('status', 'FAILED')) {
  311. // kicking off registration polls after at least one host has succeeded
  312. this.startRegistration();
  313. }
  314. if (keepPolling) {
  315. var self = this;
  316. window.setTimeout(function () {
  317. self.doBootstrap()
  318. }, 3000);
  319. }
  320. }
  321. },
  322. startRegistration: function () {
  323. if (this.get('registrationStartedAt') == null) {
  324. this.set('registrationStartedAt', new Date().getTime());
  325. console.log('registration started at ' + this.get('registrationStartedAt'));
  326. this.isHostsRegistered();
  327. }
  328. },
  329. isHostsRegistered: function () {
  330. if (this.get('stopBootstrap')) {
  331. return;
  332. }
  333. App.ajax.send({
  334. name: 'wizard.step3.is_hosts_registered',
  335. sender: this,
  336. success: 'isHostsRegisteredSuccessCallback'
  337. }).
  338. retry({
  339. times: App.maxRetries,
  340. timeout: App.timeout
  341. }).
  342. then(
  343. null,
  344. function () {
  345. App.showReloadPopup();
  346. console.log('Error: Getting registered host information from the server');
  347. }
  348. );
  349. },
  350. isHostsRegisteredSuccessCallback: function (data) {
  351. console.log('registration attempt...');
  352. var hosts = this.get('bootHosts');
  353. var jsonData = data;
  354. if (!jsonData) {
  355. console.warn("Error: jsonData is null");
  356. return;
  357. }
  358. // keep polling until all hosts have registered/failed, or registrationTimeout seconds after the last host finished bootstrapping
  359. var stopPolling = true;
  360. hosts.forEach(function (_host, index) {
  361. // Change name of first host for test mode.
  362. if (App.testMode) {
  363. if (index == 0) {
  364. _host.set('name', 'localhost.localdomain');
  365. }
  366. }
  367. // actions to take depending on the host's current bootStatus
  368. // RUNNING - bootstrap is running; leave it alone
  369. // DONE - bootstrap is done; transition to REGISTERING
  370. // REGISTERING - bootstrap is done but has not registered; transition to REGISTERED if host found in polling API result
  371. // REGISTERED - bootstrap and registration is done; leave it alone
  372. // FAILED - either bootstrap or registration failed; leave it alone
  373. console.log(_host.name + ' bootStatus=' + _host.get('bootStatus'));
  374. switch (_host.get('bootStatus')) {
  375. case 'DONE':
  376. _host.set('bootStatus', 'REGISTERING');
  377. _host.set('bootLog', (_host.get('bootLog') != null ? _host.get('bootLog') : '') + Em.I18n.t('installer.step3.hosts.bootLog.registering'));
  378. // update registration timestamp so that the timeout is computed from the last host that finished bootstrapping
  379. this.set('registrationStartedAt', new Date().getTime());
  380. stopPolling = false;
  381. break;
  382. case 'REGISTERING':
  383. if (jsonData.items.someProperty('Hosts.host_name', _host.name)) {
  384. console.log(_host.name + ' has been registered');
  385. _host.set('bootStatus', 'REGISTERED');
  386. _host.set('bootLog', (_host.get('bootLog') != null ? _host.get('bootLog') : '') + Em.I18n.t('installer.step3.hosts.bootLog.registering'));
  387. } else {
  388. console.log(_host.name + ' is registering...');
  389. stopPolling = false;
  390. }
  391. break;
  392. case 'RUNNING':
  393. stopPolling = false;
  394. break;
  395. case 'REGISTERED':
  396. case 'FAILED':
  397. default:
  398. break;
  399. }
  400. }, this);
  401. if (stopPolling) {
  402. this.getHostInfo();
  403. } else if (hosts.someProperty('bootStatus', 'RUNNING') || new Date().getTime() - this.get('registrationStartedAt') < this.get('registrationTimeoutSecs') * 1000) {
  404. // we want to keep polling for registration status if any of the hosts are still bootstrapping (so we check for RUNNING).
  405. var self = this;
  406. window.setTimeout(function () {
  407. self.isHostsRegistered();
  408. }, 3000);
  409. } else {
  410. // registration timed out. mark all REGISTERING hosts to FAILED
  411. console.log('registration timed out');
  412. hosts.filterProperty('bootStatus', 'REGISTERING').forEach(function (_host) {
  413. _host.set('bootStatus', 'FAILED');
  414. _host.set('bootLog', (_host.get('bootLog') != null ? _host.get('bootLog') : '') + Em.I18n.t('installer.step3.hosts.bootLog.failed'));
  415. });
  416. this.getHostInfo();
  417. }
  418. },
  419. hasMoreRegisteredHosts: false,
  420. getAllRegisteredHosts: function() {
  421. App.ajax.send({
  422. name: 'wizard.step3.is_hosts_registered',
  423. sender: this,
  424. success: 'getAllRegisteredHostsCallback'
  425. });
  426. }.observes('bootHosts.@each.name'),
  427. getAllRegisteredHostsCallback: function(hosts) {
  428. var registeredHosts = [];
  429. var addedHosts = this.get('bootHosts').getEach('name');
  430. hosts.items.forEach(function(host){
  431. (addedHosts.contains(host.Hosts.host_name)) ? null : registeredHosts.push(host.Hosts.host_name);
  432. });
  433. if(registeredHosts.length) {
  434. this.set('hasMoreRegisteredHosts',true);
  435. this.set('registeredHosts',registeredHosts);
  436. } else {
  437. this.set('hasMoreRegisteredHosts',false);
  438. this.set('registeredHosts','');
  439. }
  440. },
  441. allHostsComplete: function() {
  442. var result = true;
  443. this.get('bootHosts').forEach(function(host) {
  444. var status = host.get('bootStatus');
  445. if (status != 'REGISTERED' && status != 'FAILED') {
  446. result = false;
  447. }
  448. });
  449. return result;
  450. }.property('bootHosts.@each.bootStatus'),
  451. registerErrPopup: function (header, message) {
  452. App.ModalPopup.show({
  453. header: header,
  454. secondary: false,
  455. onPrimary: function () {
  456. this.hide();
  457. },
  458. bodyClass: Ember.View.extend({
  459. template: Ember.Handlebars.compile(['<p>{{view.message}}</p>'].join('\n')),
  460. message: message
  461. })
  462. });
  463. },
  464. /**
  465. * Get disk info and cpu count of booted hosts from server
  466. */
  467. getHostInfo: function () {
  468. App.ajax.send({
  469. name: 'wizard.step3.host_info',
  470. sender: this,
  471. success: 'getHostInfoSuccessCallback',
  472. error: 'getHostInfoErrorCallback'
  473. });
  474. },
  475. getHostInfoSuccessCallback: function (jsonData) {
  476. var hosts = this.get('bootHosts');
  477. this.parseWarnings(jsonData);
  478. hosts.forEach(function (_host) {
  479. var host = (App.testMode) ? jsonData.items[0] : jsonData.items.findProperty('Hosts.host_name', _host.name);
  480. if (App.skipBootstrap) {
  481. _host.cpu = 2;
  482. _host.memory = ((parseInt(2000000))).toFixed(2);
  483. _host.disk_info = [{"mountpoint": "/", "type":"ext4"},{"mountpoint": "/grid/0", "type":"ext4"}, {"mountpoint": "/grid/1", "type":"ext4"}, {"mountpoint": "/grid/2", "type":"ext4"}];
  484. } else if (host) {
  485. _host.cpu = host.Hosts.cpu_count;
  486. _host.memory = ((parseInt(host.Hosts.total_mem))).toFixed(2);
  487. _host.disk_info = host.Hosts.disk_info;
  488. console.log("The value of memory is: " + _host.memory);
  489. }
  490. });
  491. this.set('bootHosts', hosts);
  492. console.log("The value of hosts: " + JSON.stringify(hosts));
  493. this.stopRegistration();
  494. },
  495. getHostInfoErrorCallback: function () {
  496. console.log('INFO: Getting host information(cpu_count and total_mem) from the server failed');
  497. this.registerErrPopup(Em.I18n.t('installer.step3.hostInformation.popup.header'), Em.I18n.t('installer.step3.hostInformation.popup.body'));
  498. },
  499. stopRegistration: function () {
  500. this.set('isSubmitDisabled', !this.get('bootHosts').someProperty('bootStatus', 'REGISTERED'));
  501. this.set('isRetryDisabled', !this.get('bootHosts').someProperty('bootStatus', 'FAILED'));
  502. },
  503. selectCategory: function(event, context){
  504. this.set('category', event.context);
  505. },
  506. submit: function () {
  507. if (!this.get('isSubmitDisabled')) {
  508. if(this.get('isHostHaveWarnings')) {
  509. var self = this;
  510. App.showConfirmationPopup(
  511. function(){
  512. self.set('content.hosts', self.get('bootHosts'));
  513. App.router.send('next');
  514. },
  515. Em.I18n.t('installer.step3.hostWarningsPopup.hostHasWarnings'));
  516. }
  517. else {
  518. this.set('content.hosts', this.get('bootHosts'));
  519. App.router.send('next');
  520. }
  521. }
  522. },
  523. hostLogPopup: function (event, context) {
  524. var host = event.context;
  525. App.ModalPopup.show({
  526. header: Em.I18n.t('installer.step3.hostLog.popup.header').format(host.get('name')),
  527. secondary: null,
  528. onPrimary: function () {
  529. this.hide();
  530. },
  531. bodyClass: Ember.View.extend({
  532. templateName: require('templates/wizard/step3_host_log_popup'),
  533. host: host,
  534. didInsertElement: function () {
  535. var self = this;
  536. var button = $(this.get('element')).find('.textTrigger');
  537. button.click(function () {
  538. if (self.get('isTextArea')) {
  539. $(this).text(Em.I18n.t('installer.step3.hostLogPopup.highlight'));
  540. } else {
  541. $(this).text(Em.I18n.t('installer.step3.hostLogPopup.copy'));
  542. }
  543. self.set('isTextArea', !self.get('isTextArea'));
  544. });
  545. $(this.get('element')).find('.content-area').mouseenter(
  546. function () {
  547. var element = $(this);
  548. element.css('border', '1px solid #dcdcdc');
  549. button.css('visibility', 'visible');
  550. }).mouseleave(
  551. function () {
  552. var element = $(this);
  553. element.css('border', 'none');
  554. button.css('visibility', 'hidden');
  555. })
  556. },
  557. isTextArea: false,
  558. textArea: Em.TextArea.extend({
  559. didInsertElement: function () {
  560. var element = $(this.get('element'));
  561. element.width($(this.get('parentView').get('element')).width() - 10);
  562. element.height($(this.get('parentView').get('element')).height());
  563. element.select();
  564. element.css('resize', 'none');
  565. },
  566. readOnly: true,
  567. value: function () {
  568. return this.get('content');
  569. }.property('content')
  570. })
  571. })
  572. });
  573. },
  574. /**
  575. * check warnings from server and put it in parsing
  576. */
  577. rerunChecks: function () {
  578. var self = this;
  579. var currentProgress = 0;
  580. var interval = setInterval(function () {
  581. currentProgress += 100000 / self.get('warningsTimeInterval');
  582. if (currentProgress < 100) {
  583. self.set('checksUpdateProgress', currentProgress);
  584. } else {
  585. clearInterval(interval);
  586. App.ajax.send({
  587. name: 'wizard.step3.rerun_checks',
  588. sender: self,
  589. success: 'rerunChecksSuccessCallback',
  590. error: 'rerunChecksErrorCallback'
  591. });
  592. }
  593. }, 1000);
  594. },
  595. rerunChecksSuccessCallback: function (data) {
  596. this.set('checksUpdateProgress', 100);
  597. this.set('checksUpdateStatus', 'SUCCESS');
  598. this.parseWarnings(data);
  599. },
  600. rerunChecksErrorCallback: function () {
  601. this.set('checksUpdateProgress', 100);
  602. this.set('checksUpdateStatus', 'FAILED');
  603. console.log('INFO: Getting host information(last_agent_env) from the server failed');
  604. },
  605. warnings: [],
  606. warningsByHost: [],
  607. warningsTimeInterval: 60000,
  608. /**
  609. * check are hosts have any warnings
  610. */
  611. isHostHaveWarnings: function(){
  612. return this.get('warnings.length') > 0;
  613. }.property('warnings'),
  614. isWarningsBoxVisible: function(){
  615. return (App.testMode) ? true : this.get('allHostsComplete');
  616. }.property('allHostsComplete'),
  617. checksUpdateProgress:0,
  618. checksUpdateStatus: null,
  619. /**
  620. * filter data for warnings parse
  621. * is data from host in bootStrap
  622. * @param data
  623. * @return {Object}
  624. */
  625. filterBootHosts: function (data) {
  626. var bootHostNames = this.get('bootHosts').mapProperty('name');
  627. var filteredData = {
  628. href: data.href,
  629. items: []
  630. };
  631. data.items.forEach(function (host) {
  632. if (bootHostNames.contains(host.Hosts.host_name)) {
  633. filteredData.items.push(host);
  634. }
  635. });
  636. return filteredData;
  637. },
  638. /**
  639. * parse warnings data for each host and total
  640. * @param data
  641. */
  642. parseWarnings: function (data) {
  643. data = App.testMode ? data : this.filterBootHosts(data);
  644. var warnings = [];
  645. var warning;
  646. var hosts = [];
  647. data.items.sort(function (a, b) {
  648. if (a.Hosts.host_name > b.Hosts.host_name) {
  649. return 1;
  650. }
  651. if (a.Hosts.host_name < b.Hosts.host_name) {
  652. return -1;
  653. }
  654. return 0;
  655. });
  656. data.items.forEach(function (_host) {
  657. var host = {
  658. name: _host.Hosts.host_name,
  659. warnings: []
  660. }
  661. if (!_host.Hosts.last_agent_env) {
  662. // in some unusual circumstances when last_agent_env is not available from the _host,
  663. // skip the _host and proceed to process the rest of the hosts.
  664. console.log("last_agent_env is missing for " + _host.Hosts.host_name + ". Skipping _host check.");
  665. return;
  666. }
  667. //parse all directories and files warnings for host
  668. //todo: to be removed after check in new API
  669. var stackFoldersAndFiles = _host.Hosts.last_agent_env.stackFoldersAndFiles || _host.Hosts.last_agent_env.paths;
  670. stackFoldersAndFiles.forEach(function (path) {
  671. warning = warnings.filterProperty('category', 'fileFolders').findProperty('name', path.name);
  672. if (warning) {
  673. warning.hosts.push(_host.Hosts.host_name);
  674. warning.onSingleHost = false;
  675. } else {
  676. warning = {
  677. name: path.name,
  678. hosts: [_host.Hosts.host_name],
  679. category: 'fileFolders',
  680. onSingleHost: true
  681. }
  682. warnings.push(warning);
  683. }
  684. host.warnings.push(warning);
  685. }, this);
  686. //parse all package warnings for host
  687. _host.Hosts.last_agent_env.installedPackages.forEach(function (_package) {
  688. warning = warnings.filterProperty('category', 'packages').findProperty('name', _package.name);
  689. if (warning) {
  690. warning.hosts.push(_host.Hosts.host_name);
  691. warning.version = _package.version,
  692. warning.onSingleHost = false;
  693. } else {
  694. warning = {
  695. name: _package.name,
  696. version: _package.version,
  697. hosts: [_host.Hosts.host_name],
  698. category: 'packages',
  699. onSingleHost: true
  700. }
  701. warnings.push(warning);
  702. }
  703. host.warnings.push(warning);
  704. }, this);
  705. //parse all process warnings for host
  706. //todo: to be removed after check in new API
  707. var javaProcs = _host.Hosts.last_agent_env.hostHealth ? _host.Hosts.last_agent_env.hostHealth.activeJavaProcs : _host.Hosts.last_agent_env.javaProcs;
  708. javaProcs.forEach(function (process) {
  709. warning = warnings.filterProperty('category', 'processes').findProperty('pid', process.pid);
  710. if (warning) {
  711. warning.hosts.push(_host.Hosts.host_name);
  712. warning.onSingleHost = false;
  713. } else {
  714. warning = {
  715. name: (process.command.substr(0, 35) + '...'),
  716. hosts: [_host.Hosts.host_name],
  717. category: 'processes',
  718. user: process.user,
  719. pid: process.pid,
  720. command: '<table><tr><td style="word-break: break-all;">' +
  721. ((process.command.length < 500) ? process.command : process.command.substr(0, 230) + '...' +
  722. '<p style="text-align: center">................</p>' +
  723. '...' + process.command.substr(-230)) + '</td></tr></table>',
  724. onSingleHost: true
  725. }
  726. warnings.push(warning);
  727. }
  728. host.warnings.push(warning);
  729. }, this);
  730. //parse all service warnings for host
  731. //todo: to be removed after check in new API
  732. if (_host.Hosts.last_agent_env.hostHealth && _host.Hosts.last_agent_env.hostHealth.liveServices) {
  733. _host.Hosts.last_agent_env.hostHealth.liveServices.forEach(function (service) {
  734. if (service.status === 'Unhealthy') {
  735. warning = warnings.filterProperty('category', 'services').findProperty('name', service.name);
  736. if (warning) {
  737. warning.hosts.push(_host.Hosts.host_name);
  738. warning.onSingleHost = false;
  739. } else {
  740. warning = {
  741. name: service.name,
  742. hosts: [_host.Hosts.host_name],
  743. category: 'services',
  744. onSingleHost: true
  745. }
  746. warnings.push(warning);
  747. }
  748. host.warnings.push(warning);
  749. }
  750. }, this);
  751. }
  752. //parse all user warnings for host
  753. //todo: to be removed after check in new API
  754. if (_host.Hosts.last_agent_env.existingUsers) {
  755. _host.Hosts.last_agent_env.existingUsers.forEach(function (user) {
  756. warning = warnings.filterProperty('category', 'users').findProperty('name', user.userName);
  757. if (warning) {
  758. warning.hosts.push(_host.Hosts.host_name);
  759. warning.onSingleHost = false;
  760. } else {
  761. warning = {
  762. name: user.userName,
  763. hosts: [_host.Hosts.host_name],
  764. category: 'users',
  765. onSingleHost: true
  766. }
  767. warnings.push(warning);
  768. }
  769. host.warnings.push(warning);
  770. }, this);
  771. }
  772. //parse misc warnings for host
  773. var umask = _host.Hosts.last_agent_env.umask;
  774. if (umask && umask !== 18) {
  775. warning = warnings.filterProperty('category', 'misc').findProperty('name', umask);
  776. if (warning) {
  777. warning.hosts.push(_host.Hosts.host_name);
  778. warning.onSingleHost = false;
  779. } else {
  780. warning = {
  781. name: umask,
  782. hosts: [_host.Hosts.host_name],
  783. category: 'misc',
  784. onSingleHost: true
  785. }
  786. warnings.push(warning);
  787. }
  788. host.warnings.push(warning);
  789. }
  790. var firewallRunning = _host.Hosts.last_agent_env.iptablesIsRunning;
  791. if (firewallRunning!==null && firewallRunning) {
  792. var name = Em.I18n.t('installer.step3.hostWarningsPopup.firewall.name');
  793. warning = warnings.filterProperty('category', 'firewall').findProperty('name', name);
  794. if (warning) {
  795. warning.hosts.push(_host.Hosts.host_name);
  796. warning.onSingleHost = false;
  797. } else {
  798. warning = {
  799. name: name,
  800. hosts: [_host.Hosts.host_name],
  801. category: 'firewall',
  802. onSingleHost: true
  803. }
  804. warnings.push(warning);
  805. }
  806. host.warnings.push(warning);
  807. }
  808. hosts.push(host);
  809. }, this);
  810. warnings.forEach(function (warn) {
  811. if (warn.hosts.length < 11) {
  812. warn.hostsList = warn.hosts.join('<br>')
  813. } else {
  814. warn.hostsList = warn.hosts.slice(0,10).join('<br>') + '<br> ' + Em.I18n.t('installer.step3.hostWarningsPopup.moreHosts').format(warn.hosts.length - 10);
  815. }
  816. });
  817. hosts.unshift({
  818. name: 'All Hosts',
  819. warnings: warnings
  820. });
  821. this.set('warnings', warnings);
  822. this.set('warningsByHost', hosts);
  823. },
  824. /**
  825. * open popup that contain hosts' warnings
  826. * @param event
  827. */
  828. hostWarningsPopup: function(event){
  829. var self = this;
  830. App.ModalPopup.show({
  831. header: Em.I18n.t('installer.step3.warnings.popup.header'),
  832. secondary: Em.I18n.t('installer.step3.hostWarningsPopup.rerunChecks'),
  833. primary: Em.I18n.t('common.close'),
  834. onPrimary: function () {
  835. self.set('checksUpdateStatus', null);
  836. this.hide();
  837. },
  838. onClose: function(){
  839. self.set('checksUpdateStatus', null);
  840. this.hide();
  841. },
  842. onSecondary: function() {
  843. self.rerunChecks();
  844. },
  845. didInsertElement: function () {
  846. this.fitHeight();
  847. },
  848. footerClass: Ember.View.extend({
  849. template: Ember.Handlebars.compile([
  850. '<div class="update-progress pull-left">',
  851. '{{#if view.isUpdateInProgress}}',
  852. '<div class="progress-info active progress">',
  853. '<div class="bar" {{bindAttr style="view.progressWidth"}}></div></div>',
  854. '{{else}}<label {{bindAttr class="view.updateStatusClass"}}>{{view.updateStatus}}</label>',
  855. '{{/if}}</div>',
  856. '{{#if view.parentView.secondary}}<button type="button" class="btn btn-info" {{bindAttr disabled="view.isUpdateInProgress"}} {{action onSecondary target="view.parentView"}}><i class="icon-repeat"></i>&nbsp;{{view.parentView.secondary}}</button>{{/if}}',
  857. '{{#if view.parentView.primary}}<button type="button" class="btn" {{action onPrimary target="view.parentView"}}>{{view.parentView.primary}}</button>{{/if}}'
  858. ].join('')),
  859. classNames: ['modal-footer', 'host-checks-update'],
  860. progressWidth: function(){
  861. return 'width:'+App.router.get('wizardStep3Controller.checksUpdateProgress')+'%';
  862. }.property('App.router.wizardStep3Controller.checksUpdateProgress'),
  863. isUpdateInProgress: function(){
  864. if((App.router.get('wizardStep3Controller.checksUpdateProgress') > 0) &&
  865. (App.router.get('wizardStep3Controller.checksUpdateProgress') < 100)){
  866. return true;
  867. }
  868. }.property('App.router.wizardStep3Controller.checksUpdateProgress'),
  869. updateStatusClass:function(){
  870. var status = App.router.get('wizardStep3Controller.checksUpdateStatus');
  871. if(status === 'SUCCESS'){
  872. return 'text-success';
  873. } else if(status === 'FAILED'){
  874. return 'text-error';
  875. } else {
  876. return null;
  877. }
  878. }.property('App.router.wizardStep3Controller.checksUpdateStatus'),
  879. updateStatus:function(){
  880. var status = App.router.get('wizardStep3Controller.checksUpdateStatus');
  881. if(status === 'SUCCESS'){
  882. return Em.I18n.t('installer.step3.warnings.updateChecks.success');
  883. } else if(status === 'FAILED'){
  884. return Em.I18n.t('installer.step3.warnings.updateChecks.failed');
  885. } else {
  886. return null;
  887. }
  888. }.property('App.router.wizardStep3Controller.checksUpdateStatus')
  889. }),
  890. bodyClass: Ember.View.extend({
  891. templateName: require('templates/wizard/step3_host_warnings_popup'),
  892. classNames: ['host-check'],
  893. didInsertElement: function () {
  894. Ember.run.next(this, function () {
  895. this.$("[rel='HostsListTooltip']").tooltip({html: true, placement: "right"});
  896. this.$('#process .warning-name').tooltip({html: true, placement: "top"});
  897. })
  898. }.observes('content'),
  899. warningsByHost: function () {
  900. return App.router.get('wizardStep3Controller.warningsByHost');
  901. }.property('App.router.wizardStep3Controller.warningsByHost'),
  902. warnings: function () {
  903. return App.router.get('wizardStep3Controller.warnings');
  904. }.property('App.router.wizardStep3Controller.warnings'),
  905. categories: function () {
  906. return this.get('warningsByHost').mapProperty('name');
  907. }.property('warningsByHost'),
  908. category: 'All Hosts',
  909. categoryWarnings: function () {
  910. return this.get('warningsByHost').findProperty('name', this.get('category')).warnings
  911. }.property('warningsByHost', 'category'),
  912. content: function () {
  913. var categoryWarnings = this.get('categoryWarnings');
  914. return [
  915. Ember.Object.create({
  916. warnings: categoryWarnings.filterProperty('category', 'firewall'),
  917. title: Em.I18n.t('installer.step3.hostWarningsPopup.firewall'),
  918. message: Em.I18n.t('installer.step3.hostWarningsPopup.firewall.message'),
  919. type: Em.I18n.t('common.issues'),
  920. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.firewall'),
  921. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.running'),
  922. category: 'firewall'
  923. }),
  924. Ember.Object.create({
  925. warnings: categoryWarnings.filterProperty('category', 'processes'),
  926. title: Em.I18n.t('installer.step3.hostWarningsPopup.process'),
  927. message: Em.I18n.t('installer.step3.hostWarningsPopup.processes.message'),
  928. type: Em.I18n.t('common.process'),
  929. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.processes'),
  930. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.running'),
  931. category: 'process'
  932. }),
  933. Ember.Object.create({
  934. warnings: categoryWarnings.filterProperty('category', 'packages'),
  935. title: Em.I18n.t('installer.step3.hostWarningsPopup.package'),
  936. message: Em.I18n.t('installer.step3.hostWarningsPopup.packages.message'),
  937. type: Em.I18n.t('common.package'),
  938. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.packages'),
  939. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.installed'),
  940. category: 'package'
  941. }),
  942. Ember.Object.create({
  943. warnings: categoryWarnings.filterProperty('category', 'fileFolders'),
  944. title: Em.I18n.t('installer.step3.hostWarningsPopup.fileAndFolder'),
  945. message: Em.I18n.t('installer.step3.hostWarningsPopup.fileFolders.message'),
  946. type: Em.I18n.t('common.path'),
  947. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.filesAndFolders'),
  948. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
  949. category: 'fileFolders'
  950. }),
  951. Ember.Object.create({
  952. warnings: categoryWarnings.filterProperty('category', 'services'),
  953. title: Em.I18n.t('installer.step3.hostWarningsPopup.service'),
  954. message: Em.I18n.t('installer.step3.hostWarningsPopup.services.message'),
  955. type: Em.I18n.t('common.service'),
  956. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.services'),
  957. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.notRunning'),
  958. category: 'service'
  959. }),
  960. Ember.Object.create({
  961. warnings: categoryWarnings.filterProperty('category', 'users'),
  962. title: Em.I18n.t('installer.step3.hostWarningsPopup.user'),
  963. message: Em.I18n.t('installer.step3.hostWarningsPopup.users.message'),
  964. type: Em.I18n.t('common.user'),
  965. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.users'),
  966. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
  967. category: 'user'
  968. }),
  969. Ember.Object.create({
  970. warnings: categoryWarnings.filterProperty('category', 'misc'),
  971. title: Em.I18n.t('installer.step3.hostWarningsPopup.misc'),
  972. message: Em.I18n.t('installer.step3.hostWarningsPopup.misc.message'),
  973. type: Em.I18n.t('installer.step3.hostWarningsPopup.misc.umask'),
  974. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.misc'),
  975. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
  976. category: 'misc'
  977. })
  978. ]
  979. }.property('category', 'warningsByHost'),
  980. showHostsPopup: function (hosts) {
  981. $('.tooltip').hide();
  982. App.ModalPopup.show({
  983. header: Em.I18n.t('installer.step3.hostWarningsPopup.allHosts'),
  984. bodyClass: Ember.View.extend({
  985. hosts: hosts.context,
  986. template: Ember.Handlebars.compile('<ul>{{#each host in view.hosts}}<li>{{host}}</li>{{/each}}</ul>')
  987. }),
  988. onPrimary: function () {
  989. this.hide();
  990. },
  991. secondary: null
  992. });
  993. },
  994. onToggleBlock: function (category) {
  995. this.$('#' + category.context.category).toggle('blind', 500);
  996. },
  997. warningsNotice: function () {
  998. var warnings = this.get('warnings');
  999. var warningsByHost = self.get('warningsByHost').slice();
  1000. warningsByHost.shift();
  1001. var issues = warnings.length + ' ' + (warnings.length === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.issue') : Em.I18n.t('installer.step3.hostWarningsPopup.issues'));
  1002. var hostsNumber = warningsByHost.length - warningsByHost.filterProperty('warnings.length', 0).length;
  1003. var hosts = hostsNumber + ' ' + (hostsNumber === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.host') : Em.I18n.t('installer.step3.hostWarningsPopup.hosts'));
  1004. return Em.I18n.t('installer.step3.hostWarningsPopup.summary').format(issues, hosts);
  1005. }.property('warnings', 'warningsByHost'),
  1006. /**
  1007. * generate detailed content to show it in new window
  1008. */
  1009. contentInDetails: function () {
  1010. var content = this.get('content');
  1011. var warningsByHost = this.get('warningsByHost').slice();
  1012. warningsByHost.shift();
  1013. var newContent = '';
  1014. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.header') + new Date;
  1015. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.hosts');
  1016. newContent += warningsByHost.filterProperty('warnings.length').mapProperty('name').join(' ');
  1017. if (content.findProperty('category', 'fileFolders').warnings.length) {
  1018. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.fileFolders');
  1019. newContent += content.findProperty('category', 'fileFolders').warnings.mapProperty('name').join(' ');
  1020. }
  1021. if (content.findProperty('category', 'process').warnings.length) {
  1022. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.process');
  1023. content.findProperty('category', 'process').warnings.forEach(function (process, i) {
  1024. process.hosts.forEach(function (host, j) {
  1025. if (!!i || !!j) {
  1026. newContent += ',';
  1027. }
  1028. newContent += '(' + host + ',' + process.user + ',' + process.pid + ')';
  1029. });
  1030. });
  1031. }
  1032. if (content.findProperty('category', 'package').warnings.length) {
  1033. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.package');
  1034. newContent += content.findProperty('category', 'package').warnings.mapProperty('name').join(' ');
  1035. }
  1036. if (content.findProperty('category', 'service').warnings.length) {
  1037. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.service');
  1038. newContent += content.findProperty('category', 'service').warnings.mapProperty('name').join(' ');
  1039. }
  1040. if (content.findProperty('category', 'user').warnings.length) {
  1041. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.user');
  1042. newContent += content.findProperty('category', 'user').warnings.mapProperty('name').join(' ');
  1043. }
  1044. newContent += '</p>';
  1045. return newContent;
  1046. }.property('content', 'warningsByHost'),
  1047. /**
  1048. * open new browser tab with detailed content
  1049. */
  1050. openWarningsInDialog: function(){
  1051. var newWindow = window.open('');
  1052. var newDocument = newWindow.document;
  1053. newDocument.write(this.get('contentInDetails'));
  1054. newWindow.focus();
  1055. }
  1056. })
  1057. })
  1058. },
  1059. registeredHostsPopup: function(){
  1060. var self = this;
  1061. App.ModalPopup.show({
  1062. header: Em.I18n.t('installer.step3.warning.registeredHosts').format(this.get('registeredHosts').length),
  1063. secondary: null,
  1064. bodyClass: Ember.View.extend({
  1065. template: Ember.Handlebars.compile([
  1066. '<p>{{view.message}}</p>',
  1067. '<ul>{{#each host in view.registeredHosts}}',
  1068. '<li>{{host}}</li>',
  1069. '{{/each}}</ul>'
  1070. ].join('')),
  1071. message: Em.I18n.t('installer.step3.registeredHostsPopup'),
  1072. registeredHosts: self.get('registeredHosts')
  1073. })
  1074. })
  1075. },
  1076. back: function () {
  1077. if (this.get('isInstallInProgress')) {
  1078. return;
  1079. }
  1080. App.router.send('back');
  1081. }
  1082. });