step9_controller.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  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.WizardStep9Controller = Em.Controller.extend({
  20. name: 'wizardStep9Controller',
  21. hosts: [],
  22. progress: '0',
  23. isStepCompleted: false,
  24. isSubmitDisabled: function () {
  25. //return false;
  26. return !this.get('isStepCompleted'); //TODO: uncomment after the hook up
  27. }.property('isStepCompleted'),
  28. mockHostData: require('data/mock/step9_hosts'),
  29. pollDataCounter: 0,
  30. polledData: [],
  31. status: function () {
  32. if (this.hosts.everyProperty('status', 'success')) {
  33. return 'success';
  34. } else if (this.hosts.someProperty('status', 'failed')) {
  35. return 'failed';
  36. } else if (this.hosts.someProperty('status', 'warning')) {
  37. return 'warning';
  38. } else {
  39. return 'info';
  40. }
  41. }.property('hosts.@each.status'),
  42. navigateStep: function () {
  43. //TODO: uncomment following line after the hook up with the API call
  44. if (this.get('content.cluster.isCompleted') === false) {
  45. this.loadStep();
  46. if (App.db.getClusterStatus().isInstallError === true) {
  47. this.set('isStepCompleted', true);
  48. this.set('status', 'failed');
  49. this.set('progress', '100');
  50. } else if (App.db.getClusterStatus().isStartError === true) {
  51. this.launchStartServices();
  52. } else {
  53. this.startPolling();
  54. }
  55. } else {
  56. this.set('isStepCompleted', true);
  57. this.set('progress', '100');
  58. }
  59. },
  60. clearStep: function () {
  61. this.hosts.clear();
  62. this.set('status', 'info');
  63. this.set('progress', '0');
  64. this.set('isStepCompleted', false);
  65. },
  66. loadStep: function () {
  67. console.log("TRACE: Loading step9: Install, Start and Test");
  68. this.clearStep();
  69. this.renderHosts(this.loadHosts());
  70. },
  71. loadHosts: function () {
  72. var hostInfo = [];
  73. hostInfo = App.db.getHosts();
  74. var hosts = new Ember.Set();
  75. for (var index in hostInfo) {
  76. hosts.add(hostInfo[index]);
  77. console.log("TRACE: host name is: " + hostInfo[index].name);
  78. }
  79. return hosts;
  80. //return hosts.filterProperty('bootStatus', 'success'); //TODO: uncomment after actual hookup with bootstrap
  81. },
  82. renderHosts: function (hostsInfo) {
  83. hostsInfo.forEach(function (_hostInfo) {
  84. var hostInfo = App.HostInfo.create({
  85. name: _hostInfo.name,
  86. status: _hostInfo.status,
  87. tasks: _hostInfo.tasks,
  88. message: _hostInfo.message,
  89. progress: _hostInfo.progress
  90. });
  91. console.log('pushing ' + hostInfo.name);
  92. this.hosts.pushObject(hostInfo);
  93. }, this);
  94. },
  95. replacePolledData: function (polledData) {
  96. this.polledData.clear;
  97. this.set('polledData', polledData);
  98. console.log('*******/ In replace PolledData function **********/');
  99. console.log("The value of polleddata is: " + polledData);
  100. console.log("2.The value of polleddata is: " + this.get('polledData'));
  101. this.get('polledData').forEach(function (_data) {
  102. console.log('The name of the host is: ' + _data.Tasks.host_name);
  103. console.log('The status of the task is: ' + _data.Tasks.status);
  104. }, this);
  105. },
  106. displayMessage: function (task) {
  107. console.log("In display message with task command value: " + task.command);
  108. switch (task.command) {
  109. case 'INSTALL':
  110. switch (task.status) {
  111. case 'PENDING':
  112. return 'Preparing to install ' + task.role;
  113. case 'QUEUED' :
  114. return task.role + ' is Queued for installation';
  115. case 'IN_PROGRESS':
  116. return 'Installing ' + task.role;
  117. case 'COMPLETED' :
  118. return 'Successfully installed ' + task.role;
  119. case 'FAILED':
  120. return 'Faliure in installing ' + task.role;
  121. }
  122. case 'UNINSTALL':
  123. switch (task.status) {
  124. case 'PENDING':
  125. return 'Preparing to uninstall ' + task.role;
  126. case 'QUEUED' :
  127. return task.role + ' is Queued for uninstallation';
  128. case 'IN_PROGRESS':
  129. return 'Unnstalling ' + task.role;
  130. case 'COMPLETED' :
  131. return 'Successfully uninstalled ' + task.role;
  132. case 'FAILED':
  133. return 'Faliure in uninstalling ' + task.role;
  134. }
  135. case 'START' :
  136. switch (task.status) {
  137. case 'PENDING':
  138. return 'Preparing to start ' + task.role;
  139. case 'QUEUED' :
  140. return task.role + ' is Queued for starting';
  141. case 'IN_PROGRESS':
  142. return 'Starting ' + task.role;
  143. case 'COMPLETED' :
  144. return task.role + ' started successfully';
  145. case 'FAILED':
  146. return task.role + ' failed to start';
  147. }
  148. case 'STOP' :
  149. switch (task.status) {
  150. case 'PENDING':
  151. return 'Preparing to stop ' + role;
  152. case 'QUEUED' :
  153. return task.role + ' is Queued for stopping';
  154. case 'IN_PROGRESS':
  155. return 'Stopping ' + task.role;
  156. case 'COMPLETED' :
  157. return role + ' stoped successfully';
  158. case 'FAILED':
  159. return role + ' failed to stop';
  160. }
  161. case 'EXECUTE' :
  162. switch (task.status) {
  163. case 'PENDING':
  164. return 'Preparing to execute' + task.role;
  165. case 'QUEUED' :
  166. return task.role + ' is Queued for execution';
  167. case 'IN_PROGRESS':
  168. return 'Execution of ' + task.role + ' in progress';
  169. case 'COMPLETED' :
  170. return task.role + ' executed successfully';
  171. case 'FAILED':
  172. return task.role + ' failed to execute';
  173. }
  174. case 'ABORT' :
  175. switch (task.status) {
  176. case 'PENDING':
  177. return 'Preparing to abort ' + task.role;
  178. case 'QUEUED' :
  179. return task.role + ' is Queued for Aborting';
  180. case 'IN_PROGRESS':
  181. return 'Aborting ' + task.role;
  182. case 'COMPLETED' :
  183. return task.role + ' aborted successfully';
  184. case 'FAILED':
  185. return task.role + ' failed to abort';
  186. }
  187. }
  188. },
  189. launchStartServices: function () {
  190. var self = this;
  191. var clusterName = this.get('content.cluster.name');
  192. var url = '/api/clusters/' + clusterName + '/services?state=INSTALLED';
  193. var data = '{"ServiceInfo": {"state": "STARTED"}}';
  194. var method = 'PUT';
  195. if (App.testMode) {
  196. debugger;
  197. url = '/data/wizard/deploy/poll_6.json';
  198. method = 'GET';
  199. this.numPolls = 6;
  200. }
  201. $.ajax({
  202. type: method,
  203. url: url,
  204. async: false,
  205. data: data,
  206. dataType: 'text',
  207. timeout: 5000,
  208. success: function (data) {
  209. var jsonData = jQuery.parseJSON(data);
  210. console.log("TRACE: Step9 -> In success function for the startService call");
  211. console.log("TRACE: Step9 -> value of the url is: " + url);
  212. console.log("TRACE: Step9 -> value of the received data is: " + jsonData);
  213. var requestId = jsonData.href.match(/.*\/(.*)$/)[1];
  214. console.log('requestId is: ' + requestId);
  215. var clusterStatus = {
  216. name: clusterName,
  217. status: 'INSTALLED',
  218. requestId: requestId,
  219. isStartError: false,
  220. isCompleted: false
  221. };
  222. App.router.get('installerController').saveClusterStatus(clusterStatus);
  223. self.startPolling();
  224. },
  225. error: function () {
  226. console.log("ERROR");
  227. var clusterStatus = {
  228. name: clusterName,
  229. status: 'PENDING',
  230. isStartError: true,
  231. isCompleted: false
  232. };
  233. App.router.get('installerController').saveClusterStatus(clusterStatus);
  234. },
  235. statusCode: require('data/statusCodes')
  236. });
  237. },
  238. onSuccessPerHost: function (actions, contentHost) {
  239. if (actions.everyProperty('Tasks.status', 'COMPLETED') && this.get('content.cluster.status') === 'INSTALLED') {
  240. contentHost.set('status', 'success');
  241. }
  242. },
  243. onWarningPerHost: function (actions, contentHost) {
  244. if (actions.findProperty('Tasks.status', 'FAILED') || actions.findProperty('Tasks.status', 'ABORTED') || actions.findProperty('Tasks.status', 'TIMEDOUT')) {
  245. console.log('step9: In warning');
  246. contentHost.set('status', 'warning');
  247. this.set('status', 'warning');
  248. }
  249. },
  250. onInProgressPerHost: function (tasks, contentHost) {
  251. var runningAction = tasks.findProperty('Tasks.status', 'IN_PROGRESS');
  252. if (runningAction === undefined || runningAction === null) {
  253. runningAction = tasks.findProperty('Tasks.status', 'QUEUED');
  254. }
  255. if (runningAction === undefined || runningAction === null) {
  256. runningAction = tasks.findProperty('Tasks.status', 'PENDING');
  257. }
  258. if (runningAction !== null && runningAction !== undefined) {
  259. contentHost.set('message', this.displayMessage(runningAction.Tasks));
  260. }
  261. },
  262. progressPerHost: function (actions, contentHost) {
  263. var progress = 0;
  264. var actionsPerHost = actions.length;
  265. var completedActions = actions.filterProperty('Tasks.status', 'COMPLETED').length
  266. + actions.filterProperty('Tasks.status', 'IN_PROGRESS').length
  267. + actions.filterProperty('Tasks.status', 'FAILED').length
  268. + actions.filterProperty('Tasks.status', 'ABORTED').length
  269. + actions.filterProperty('Tasks.status', 'TIMEDOUT').length;
  270. if (this.get('content.cluster.status') === 'PENDING') {
  271. progress = Math.floor(((completedActions / actionsPerHost) * 100) / 3);
  272. } else if (this.get('content.cluster.status') === 'INSTALLED') {
  273. progress = 34 + Math.floor(((completedActions / actionsPerHost) * 100 * 2) / 3);
  274. }
  275. console.log('INFO: progressPerHost is: ' + progress);
  276. contentHost.set('progress', progress.toString());
  277. return progress;
  278. },
  279. isSuccess: function (polledData) {
  280. return polledData.everyProperty('Tasks.status', 'COMPLETED');
  281. },
  282. isStepFailed: function (polledData) {
  283. var self = this;
  284. var result = false;
  285. polledData.forEach(function (_polledData) {
  286. _polledData.Tasks.sf = 100; //TODO: Remove this line after hook up with actual success factor
  287. var successFactor = _polledData.Tasks.sf;
  288. console.log("Step9: isStepFailed sf value: " + successFactor);
  289. var actionsPerRole = polledData.filterProperty('Tasks.role', _polledData.Tasks.role);
  290. var actionsFailed = actionsPerRole.filterProperty('Tasks.status', 'FAILED');
  291. var actionsAborted = actionsPerRole.filterProperty('Tasks.status', 'ABORTED');
  292. var actionsTimedOut = actionsPerRole.filterProperty('Tasks.status', 'TIMEDOUT');
  293. if ((((actionsFailed.length + actionsAborted.length + actionsTimedOut.length) / actionsPerRole.length) * 100) > (100 - successFactor)) {
  294. console.log('TRACE: Entering success factor and result is failed');
  295. result = true;
  296. }
  297. });
  298. return result;
  299. },
  300. getFailedHostsForFailedRoles: function (polledData) {
  301. var hostArr = new Ember.Set();
  302. polledData.forEach(function (_polledData) {
  303. _polledData.sf = 100; //TODO: Remove this line after hook up with actual success factor
  304. var successFactor = _polledData.sf;
  305. var actionsPerRole = polledData.filterProperty('Tasks.role', _polledData.Tasks.role);
  306. var actionsFailed = actionsPerRole.filterProperty('Tasks.status', 'FAILED');
  307. var actionsAborted = actionsPerRole.filterProperty('Tasks.status', 'ABORTED');
  308. var actionsTimedOut = actionsPerRole.filterProperty('Tasks.status', 'TIMEDOUT');
  309. if ((((actionsFailed.length + actionsAborted.length + actionsTimedOut.length) / actionsPerRole.length) * 100) > (100 - successFactor)) {
  310. actionsFailed.forEach(function (_actionFailed) {
  311. hostArr.add(_actionFailed.Tasks.host_name);
  312. });
  313. actionsAborted.forEach(function (_actionFailed) {
  314. hostArr.add(_actionFailed.Tasks.host_name);
  315. });
  316. actionsTimedOut.forEach(function (_actionFailed) {
  317. hostArr.add(_actionFailed.Tasks.host_name);
  318. });
  319. }
  320. });
  321. return hostArr;
  322. },
  323. setHostsStatus: function (hostNames, status) {
  324. hostNames.forEach(function (_hostName) {
  325. var host = this.hosts.findProperty('name', _hostName);
  326. host.set('status', status);
  327. host.set('progress', '100');
  328. }, this);
  329. },
  330. // polling from ui stops only when no action has 'PENDING', 'QUEUED' or 'IN_PROGRESS' status
  331. finishState: function (polledData) {
  332. var clusterStatus = {};
  333. var requestId = this.get('content.cluster.requestId');
  334. if (this.get('content.cluster.status') === 'INSTALLED') {
  335. if (!polledData.someProperty('Tasks.status', 'PENDING') && !polledData.someProperty('Tasks.status', 'QUEUED') && !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
  336. this.set('progress', '100');
  337. clusterStatus = {
  338. status: 'INSTALLED',
  339. requestId: requestId,
  340. isCompleted: true
  341. }
  342. if (this.isSuccess(polledData)) {
  343. clusterStatus.status = 'STARTED';
  344. this.set('status', 'success');
  345. } else {
  346. if (this.isStepFailed(polledData)) {
  347. clusterStatus.status = 'FAILED';
  348. this.set('status', 'failed');
  349. this.setHostsStatus(this.getFailedHostsForFailedRoles(polledData));
  350. }
  351. }
  352. App.router.get('installerController').saveClusterStatus(clusterStatus);
  353. this.set('isStepCompleted', true);
  354. return true;
  355. }
  356. } else if (this.get('content.cluster.status') === 'PENDING') {
  357. if (!polledData.someProperty('Tasks.status', 'PENDING') && !polledData.someProperty('Tasks.status', 'QUEUED') && !polledData.someProperty('Tasks.status', 'IN_PROGRESS')) {
  358. clusterStatus = {
  359. status: 'PENDING',
  360. requestId: requestId,
  361. isCompleted: true
  362. }
  363. if (this.isStepFailed(polledData)) {
  364. clusterStatus.status = 'FAILED';
  365. this.set('progress', '100');
  366. this.set('status', 'failed');
  367. this.setHostsStatus(this.getFailedHostsForFailedRoles(polledData), 'failed');
  368. App.router.get('installerController').saveClusterStatus(clusterStatus);
  369. this.set('isStepCompleted', true);
  370. } else {
  371. clusterStatus.status = 'INSTALLED';
  372. this.set('progress', '34');
  373. App.router.get('installerController').saveInstalledHosts(this);
  374. this.launchStartServices(); //TODO: uncomment after the actual hookup
  375. }
  376. return true;
  377. }
  378. }
  379. return false;
  380. },
  381. getCompletedTasksForHost: function (host) {
  382. var hostname = host.get('name');
  383. var tasksPerHost = host.tasks.filterProperty('Tasks.host_name', hostname);
  384. var succededTasks = tasksPerHost.filterProperty('Tasks.status', 'COMPLETED');
  385. var inProgressTasks = tasksPerHost.filterProperty('Tasks.status', 'IN_PROGRESS');
  386. var listedTasksPerHost = succededTasks.concat(inProgressTasks).uniq();
  387. return listedTasksPerHost;
  388. },
  389. // This is done at HostRole level.
  390. setTasksStatePerHost: function (tasksPerHost, host) {
  391. var tasks = [];
  392. tasksPerHost.forEach(function (_taskPerHost) {
  393. if (_taskPerHost.Tasks.status !== 'PENDING' && _taskPerHost.Tasks.status !== 'QUEUED') {
  394. var task = host.tasks.findProperty('Tasks.id', _taskPerHost.Tasks.id);
  395. if (!(task && (task.Tasks.command === _taskPerHost.Tasks.command))) {
  396. host.tasks.pushObject(_taskPerHost);
  397. }
  398. }
  399. }, this);
  400. },
  401. parseHostInfo: function (polledData) {
  402. console.log('TRACE: Entering host info function');
  403. var self = this;
  404. var totalProgress = 0;
  405. /* if (this.get('content.cluster.status') === 'INSTALLED') {
  406. totalProgress = 34;
  407. } else {
  408. totalProgress = 0;
  409. } */
  410. var tasksData = polledData.tasks;
  411. console.log("The value of tasksData is: " + tasksData);
  412. if (!tasksData) {
  413. console.log("Step9: ERROR: NO tasks availaible to process");
  414. }
  415. this.replacePolledData(tasksData);
  416. this.hosts.forEach(function (_host) {
  417. var actionsPerHost = tasksData.filterProperty('Tasks.host_name', _host.name); // retrieved from polled Data
  418. if (actionsPerHost.length === 0) {
  419. //alert('For testing with mockData follow the sequence: hit referesh,"mockData btn", "pollData btn", again "pollData btn"');
  420. //exit();
  421. }
  422. if (actionsPerHost !== null && actionsPerHost !== undefined && actionsPerHost.length !== 0) {
  423. this.onSuccessPerHost(actionsPerHost, _host); // every action should be a success
  424. this.onWarningPerHost(actionsPerHost, _host); // any action should be a faliure
  425. this.onInProgressPerHost(actionsPerHost, _host); // current running action for a host
  426. this.setTasksStatePerHost(actionsPerHost, _host);
  427. totalProgress = self.progressPerHost(actionsPerHost, _host);
  428. }
  429. }, this);
  430. totalProgress = Math.floor(totalProgress / this.hosts.length);
  431. this.set('progress', totalProgress.toString());
  432. console.log("INFO: right now the progress is: " + this.get('progress'));
  433. return this.finishState(tasksData);
  434. },
  435. startPolling: function () {
  436. this.set('isSubmitDisabled', true);
  437. this.doPolling();
  438. },
  439. numPolls: 0,
  440. getUrl: function () {
  441. var clusterName = this.get('content.cluster.name');
  442. var requestId = App.db.getClusterStatus().requestId;
  443. var url = '/api/clusters/' + clusterName + '/requests/' + requestId;
  444. console.log("URL for step9 is: " + url);
  445. return url;
  446. },
  447. POLL_INTERVAL: 4000,
  448. doPolling: function () {
  449. var self = this;
  450. var url = this.getUrl();
  451. if (App.testMode) {
  452. this.POLL_INTERVAL = 1;
  453. this.numPolls++;
  454. if (this.numPolls == 5) {
  455. // url = 'data/wizard/deploy/poll_5.json';
  456. url = 'data/wizard/deploy/poll_5_failed.json';
  457. } else {
  458. url = 'data/wizard/deploy/poll_' + this.numPolls + '.json';
  459. }
  460. debugger;
  461. }
  462. $.ajax({
  463. type: 'GET',
  464. url: url,
  465. async: true,
  466. timeout: 10000,
  467. dataType: 'text',
  468. success: function (data) {
  469. console.log("TRACE: In success function for the GET bootstrap call");
  470. console.log("TRACE: STep9 -> The value is: " + jQuery.parseJSON(data));
  471. var result = self.parseHostInfo(jQuery.parseJSON(data));
  472. if (result !== true) {
  473. window.setTimeout(function () {
  474. self.doPolling();
  475. }, self.POLL_INTERVAL);
  476. } else {
  477. self.stopPolling();
  478. }
  479. },
  480. error: function (request, ajaxOptions, error) {
  481. console.log("TRACE: STep9 -> In error function for the getService call");
  482. console.log("TRACE: STep9 -> value of the url is: " + url);
  483. console.log("TRACE: STep9 -> error code status is: " + request.status);
  484. self.stopPolling();
  485. },
  486. statusCode: require('data/statusCodes')
  487. });
  488. },
  489. stopPolling: function () {
  490. //TODO: uncomment following line after the hook up with the API call
  491. // this.set('isStepCompleted',true);
  492. },
  493. submit: function () {
  494. if (!this.get('isSubmitDisabled')) {
  495. this.set('content.cluster.status', this.get('status'));
  496. this.set('content.cluster.isCompleted', true);
  497. App.router.send('next');
  498. }
  499. },
  500. back: function () {
  501. if (!this.get('isSubmitDisabled')) {
  502. App.router.send('back');
  503. }
  504. },
  505. mockBtn: function () {
  506. this.set('isSubmitDisabled', false);
  507. this.hosts.clear();
  508. var hostInfo = this.mockHostData;
  509. this.renderHosts(hostInfo);
  510. },
  511. pollBtn: function () {
  512. this.set('isSubmitDisabled', false);
  513. var data1 = require('data/mock/step9PolledData/pollData_1');
  514. var data2 = require('data/mock/step9PolledData/pollData_2');
  515. var data3 = require('data/mock/step9PolledData/pollData_3');
  516. var data4 = require('data/mock/step9PolledData/pollData_4');
  517. var data5 = require('data/mock/step9PolledData/pollData_5');
  518. var data6 = require('data/mock/step9PolledData/pollData_6');
  519. var data7 = require('data/mock/step9PolledData/pollData_7');
  520. var data8 = require('data/mock/step9PolledData/pollData_8');
  521. var data9 = require('data/mock/step9PolledData/pollData_9');
  522. console.log("TRACE: In pollBtn function data1");
  523. var counter = parseInt(this.get('pollDataCounter')) + 1;
  524. this.set('pollDataCounter', counter.toString());
  525. switch (this.get('pollDataCounter')) {
  526. case '1':
  527. this.parseHostInfo(data1);
  528. break;
  529. case '2':
  530. this.parseHostInfo(data2);
  531. break;
  532. case '3':
  533. this.parseHostInfo(data3);
  534. break;
  535. case '4':
  536. this.parseHostInfo(data4);
  537. break;
  538. case '5':
  539. this.parseHostInfo(data5);
  540. break;
  541. case '6':
  542. this.set('content.cluster.status', 'INSTALLED');
  543. this.parseHostInfo(data6);
  544. break;
  545. case '7':
  546. this.parseHostInfo(data7);
  547. break;
  548. case '8':
  549. this.parseHostInfo(data8);
  550. break;
  551. case '9':
  552. this.parseHostInfo(data9);
  553. break;
  554. default:
  555. break;
  556. }
  557. }
  558. });