hostWarningPopupBody_view.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  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. var lazyloading = require('utils/lazy_loading');
  20. var numberUtils = require('utils/number_utils');
  21. App.WizardStep3HostWarningPopupBody = Em.View.extend({
  22. templateName: require('templates/wizard/step3/step3_host_warnings_popup'),
  23. classNames: ['host-check'],
  24. bodyControllerBinding: 'App.router.wizardStep3Controller',
  25. /**
  26. * Listbox with host filters
  27. * @type {Ember.Select}
  28. */
  29. hostSelectView: Em.Select.extend({
  30. selectionBinding: "parentView.category",
  31. /**
  32. * Content has default value "All Hosts" to bind selection to category
  33. * @type {string[]}
  34. */
  35. content: ['All Hosts'],
  36. /**
  37. * List of filtered hostnames
  38. * @type {string[]}
  39. */
  40. hosts: function () {
  41. var warningsByHost = this.get('parentView.warningsByHost');
  42. if (Em.isNone(warningsByHost)) return [];
  43. return warningsByHost.mapProperty('name');
  44. }.property('parentView.warningsByHost'),
  45. /**
  46. * Is data loaded
  47. * @type {bool}
  48. */
  49. isLoaded: false,
  50. didInsertElement: function () {
  51. this.initContent();
  52. },
  53. /**
  54. * Check browser and set content for listbox
  55. * @method initContent
  56. */
  57. initContent: function () {
  58. this.set('isLoaded', false);
  59. //The lazy loading for select elements supported only by Firefox and Chrome
  60. var isBrowserSupported = $.browser.mozilla || ($.browser.safari && navigator.userAgent.indexOf('Chrome') !== -1);
  61. var isLazyLoading = isBrowserSupported && this.get('hosts').length > 100;
  62. this.set('isLazyLoading', isLazyLoading);
  63. if (isLazyLoading) {
  64. //select need at least 30 hosts to have scrollbar
  65. this.set('content', this.get('hosts').slice(0, 30));
  66. } else {
  67. this.set('content', this.get('hosts'));
  68. this.set('isLoaded', true);
  69. }
  70. }.observes('parentView.warningsByHost'),
  71. /**
  72. * On click start lazy loading
  73. * @method click
  74. */
  75. click: function () {
  76. if (!this.get('isLoaded') && this.get('isLazyLoading')) {
  77. //filter out hosts, which already pushed in select
  78. var source = this.get('hosts').filter(function (_host) {
  79. return !this.get('content').contains(_host);
  80. }, this).slice();
  81. lazyloading.run({
  82. destination: this.get('content'),
  83. source: source,
  84. context: this,
  85. initSize: 30,
  86. chunkSize: 200,
  87. delay: 50
  88. });
  89. }
  90. }
  91. }),
  92. /**
  93. * List of warnings grouped by host
  94. * Same to <code>bodyController.warningsByHost</code>
  95. * @type {Ember.Enumerable}
  96. */
  97. warningsByHost: function () {
  98. return this.get('bodyController.warningsByHost');
  99. }.property('bodyController.warningsByHost'),
  100. /**
  101. * List of all warnings
  102. * Same to <code>bodyController.warnings</code>
  103. * @type {Ember.Enumerable}
  104. */
  105. warnings: function () {
  106. return this.get('bodyController.warnings');
  107. }.property('bodyController.warnings'),
  108. /**
  109. * Selected category
  110. * @type {string}
  111. */
  112. category: 'All Hosts',
  113. /**
  114. * List of warnings for selected <code>category</code>
  115. * @type {Ember.Enumerable}
  116. */
  117. categoryWarnings: function () {
  118. var warningsByHost = this.get('warningsByHost');
  119. if (Em.isNone(warningsByHost)) return [];
  120. var category = warningsByHost.findProperty('name', this.get('category'));
  121. return Em.isNone(category) ? []: category.warnings;
  122. }.property('warningsByHost', 'category'),
  123. /**
  124. * List of warnings grouped by <code>category</code>
  125. * @type {Ember.Object[]}
  126. */
  127. content: function () {
  128. var hostCheckWarnings = this.get('bodyController.hostCheckWarnings');
  129. var repoCategoryWarnings = this.get('bodyController.repoCategoryWarnings');
  130. var diskCategoryWarnings = this.get('bodyController.diskCategoryWarnings');
  131. var jdkCategoryWarnings = this.get('bodyController.jdkCategoryWarnings') || [];
  132. var thpCategoryWarnings = this.get('bodyController.thpCategoryWarnings');
  133. var categoryWarnings = this.get('categoryWarnings');
  134. var warningsArray = [
  135. Em.Object.create({
  136. warnings: thpCategoryWarnings,
  137. title: Em.I18n.t('installer.step3.hostWarningsPopup.thp'),
  138. message: Em.I18n.t('installer.step3.hostWarningsPopup.thp.message'),
  139. type: Em.I18n.t('common.issues'),
  140. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.thp'),
  141. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.enabled'),
  142. category: 'thp'
  143. }),
  144. Em.Object.create({
  145. warnings: jdkCategoryWarnings,
  146. title: Em.I18n.t('installer.step3.hostWarningsPopup.jdk'),
  147. message: Em.I18n.t('installer.step3.hostWarningsPopup.jdk.message'),
  148. type: Em.I18n.t('common.issues'),
  149. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.jdk'),
  150. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
  151. category: 'jdk'
  152. }),
  153. Em.Object.create({
  154. warnings: diskCategoryWarnings,
  155. title: Em.I18n.t('installer.step3.hostWarningsPopup.disk'),
  156. message: Em.I18n.t('installer.step3.hostWarningsPopup.disk.message'),
  157. type: Em.I18n.t('common.issues'),
  158. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.disk'),
  159. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
  160. category: 'disk'
  161. }),
  162. Em.Object.create({
  163. warnings: repoCategoryWarnings,
  164. title: Em.I18n.t('installer.step3.hostWarningsPopup.repositories'),
  165. message: Em.I18n.t('installer.step3.hostWarningsPopup.repositories.message'),
  166. type: Em.I18n.t('common.issues'),
  167. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.repositories'),
  168. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.invalid'),
  169. category: 'repositories'
  170. }),
  171. Em.Object.create({
  172. warnings: categoryWarnings.filterProperty('category', 'firewall'),
  173. title: Em.I18n.t('installer.step3.hostWarningsPopup.firewall'),
  174. message: Em.I18n.t('installer.step3.hostWarningsPopup.firewall.message'),
  175. type: Em.I18n.t('common.issues'),
  176. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.firewall'),
  177. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.running'),
  178. category: 'firewall'
  179. }),
  180. Em.Object.create({
  181. warnings: categoryWarnings.filterProperty('category', 'processes'),
  182. title: Em.I18n.t('installer.step3.hostWarningsPopup.process'),
  183. message: Em.I18n.t('installer.step3.hostWarningsPopup.processes.message'),
  184. type: Em.I18n.t('common.process'),
  185. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.processes'),
  186. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.running'),
  187. category: 'process'
  188. }),
  189. Em.Object.create({
  190. warnings: categoryWarnings.filterProperty('category', 'packages'),
  191. title: Em.I18n.t('installer.step3.hostWarningsPopup.package'),
  192. message: Em.I18n.t('installer.step3.hostWarningsPopup.packages.message'),
  193. type: Em.I18n.t('common.package'),
  194. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.packages'),
  195. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.installed'),
  196. category: 'package'
  197. }),
  198. Em.Object.create({
  199. warnings: categoryWarnings.filterProperty('category', 'fileFolders'),
  200. title: Em.I18n.t('installer.step3.hostWarningsPopup.fileAndFolder'),
  201. message: Em.I18n.t('installer.step3.hostWarningsPopup.fileFolders.message'),
  202. type: Em.I18n.t('common.path'),
  203. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.filesAndFolders'),
  204. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
  205. category: 'fileFolders'
  206. }),
  207. Em.Object.create({
  208. warnings: categoryWarnings.filterProperty('category', 'services'),
  209. title: Em.I18n.t('installer.step3.hostWarningsPopup.service'),
  210. message: Em.I18n.t('installer.step3.hostWarningsPopup.services.message'),
  211. type: Em.I18n.t('common.service'),
  212. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.services'),
  213. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.notRunning'),
  214. category: 'service'
  215. }),
  216. Em.Object.create({
  217. warnings: categoryWarnings.filterProperty('category', 'users'),
  218. title: Em.I18n.t('installer.step3.hostWarningsPopup.user'),
  219. message: Em.I18n.t('installer.step3.hostWarningsPopup.users.message'),
  220. type: Em.I18n.t('common.user'),
  221. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.users'),
  222. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
  223. category: 'user'
  224. }),
  225. Em.Object.create({
  226. warnings: categoryWarnings.filterProperty('category', 'misc'),
  227. title: Em.I18n.t('installer.step3.hostWarningsPopup.misc'),
  228. message: Em.I18n.t('installer.step3.hostWarningsPopup.misc.message'),
  229. type: Em.I18n.t('installer.step3.hostWarningsPopup.misc.umask'),
  230. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.misc'),
  231. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
  232. category: 'misc'
  233. }),
  234. Em.Object.create({
  235. warnings: categoryWarnings.filterProperty('category', 'alternatives'),
  236. title: Em.I18n.t('installer.step3.hostWarningsPopup.alternatives'),
  237. message: Em.I18n.t('installer.step3.hostWarningsPopup.alternatives.message'),
  238. type: Em.I18n.t('installer.step3.hostWarningsPopup.alternatives.umask'),
  239. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.alternatives.empty'),
  240. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.exists'),
  241. category: 'alternatives'
  242. }),
  243. Em.Object.create({
  244. warnings: categoryWarnings.filterProperty('category', 'reverseLookup'),
  245. title: Em.I18n.t('installer.step3.hostWarningsPopup.reverseLookup'),
  246. message: Em.I18n.t('installer.step3.hostWarningsPopup.reverseLookup.message'),
  247. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.reverseLookup.empty'),
  248. category: 'reverseLookup'
  249. }),
  250. Em.Object.create({
  251. warnings: hostCheckWarnings,
  252. title: Em.I18n.t('installer.step3.hostWarningsPopup.resolution.validation.name'),
  253. message: Em.I18n.t('installer.step3.hostWarningsPopup.resolution.validation.message'),
  254. type: Em.I18n.t('common.issues'),
  255. emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.resolution.validation.empty'),
  256. action: Em.I18n.t('installer.step3.hostWarningsPopup.action.failed'),
  257. category: 'hostNameResolution'
  258. })
  259. ];
  260. warningsArray.forEach(function (warningType) {
  261. warningType.set('isCollapsed', true);
  262. warningType.get('warnings').forEach(function (warn) {
  263. var hosts = Em.get(warn, 'hosts');
  264. if (hosts) {
  265. var hostsList = hosts.length < 11 ? hosts.join('<br>') :
  266. hosts.slice(0, 10).join('<br>') + '<br> ' +
  267. Em.I18n.t('installer.step3.hostWarningsPopup.moreHosts').format(warn.hosts.length - 10);
  268. Em.set(warn, 'hostsList', hostsList);
  269. }
  270. });
  271. });
  272. return warningsArray;
  273. }.property('category', 'warningsByHost', 'bodyController.jdkCategoryWarnings', 'bodyController.repoCategoryWarnings', 'bodyController.diskCategoryWarnings', 'bodyController.hostCheckWarnings', 'bodyController.thpCategoryWarnings'),
  274. /**
  275. * Message with info about warnings
  276. * @return {string}
  277. */
  278. warningsNotice: function () {
  279. var issuesNumber = this.get('warnings.length') + this.get('bodyController.repoCategoryWarnings.length') + this.get('bodyController.diskCategoryWarnings.length')
  280. + this.get('bodyController.jdkCategoryWarnings.length') + this.get('bodyController.hostCheckWarnings.length') + this.get('bodyController.thpCategoryWarnings.length');
  281. this.set('totalWarningsCount', issuesNumber);
  282. var issues = issuesNumber + ' ' + (issuesNumber.length === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.issue') : Em.I18n.t('installer.step3.hostWarningsPopup.issues'));
  283. var hostsCnt = this.warningHostsNamesCount();
  284. var hosts = hostsCnt + ' ' + (hostsCnt === 1 ? Em.I18n.t('installer.step3.hostWarningsPopup.host') : Em.I18n.t('installer.step3.hostWarningsPopup.hosts'));
  285. return Em.I18n.t('installer.step3.hostWarningsPopup.summary').format(issues, hosts);
  286. }.property('warnings', 'warningsByHost', 'bodyController.jdkCategoryWarnings', 'bodyController.repoCategoryWarnings', 'bodyController.diskCategoryWarnings', 'bodyController.hostCheckWarnings', 'bodyController.diskCategoryWarnings'),
  287. /**
  288. * Detailed content to show it in new window
  289. * @return {string}
  290. */
  291. contentInDetails: function () {
  292. var content = this.get('content');
  293. var newContent = '';
  294. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.header') + new Date;
  295. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.hosts');
  296. newContent += this.get('hostNamesWithWarnings').join(' ');
  297. if (content.findProperty('category', 'thp').warnings.length) {
  298. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.thp');
  299. newContent += content.findProperty('category', 'thp').warnings[0].hostsLong.join(' ');
  300. }
  301. if (content.findProperty('category', 'jdk').warnings.length) {
  302. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.jdk');
  303. newContent += content.findProperty('category', 'jdk').warnings[0].hostsLong.join('<br>');
  304. }
  305. if (content.findProperty('category', 'disk').warnings.length) {
  306. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.disk');
  307. newContent += content.findProperty('category', 'disk').warnings[0].hostsLong.join('<br>');
  308. }
  309. if (content.findProperty('category', 'repositories').warnings.length) {
  310. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.repositories');
  311. newContent += content.findProperty('category', 'repositories').warnings[0].hostsLong.join('<br>');
  312. }
  313. if (content.findProperty('category', 'hostNameResolution').warnings.length) {
  314. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.hostNameResolution');
  315. newContent += content.findProperty('category', 'hostNameResolution').warnings[0].hostsLong.join('<br>');
  316. }
  317. if (content.findProperty('category', 'firewall').warnings.length) {
  318. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.firewall');
  319. newContent += content.findProperty('category', 'firewall').warnings.mapProperty('name').join('<br>');
  320. }
  321. if (content.findProperty('category', 'fileFolders').warnings.length) {
  322. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.fileFolders');
  323. newContent += content.findProperty('category', 'fileFolders').warnings.mapProperty('name').join(' ');
  324. }
  325. if (content.findProperty('category', 'reverseLookup').warnings.length) {
  326. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.reverseLookup');
  327. newContent += content.findProperty('category', 'reverseLookup').warnings[0].hostsLong.join(' ');
  328. }
  329. if (content.findProperty('category', 'process').warnings.length) {
  330. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.process');
  331. content.findProperty('category', 'process').warnings.forEach(function (process, i) {
  332. process.hosts.forEach(function (host, j) {
  333. if (!!i || !!j) {
  334. newContent += ',';
  335. }
  336. newContent += '(' + host + ',' + process.user + ',' + process.pid + ')';
  337. });
  338. });
  339. }
  340. if (content.findProperty('category', 'package').warnings.length) {
  341. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.package');
  342. newContent += content.findProperty('category', 'package').warnings.mapProperty('name').join(' ');
  343. }
  344. if (content.findProperty('category', 'service').warnings.length) {
  345. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.service');
  346. newContent += content.findProperty('category', 'service').warnings.mapProperty('name').join(' ');
  347. }
  348. if (content.findProperty('category', 'user').warnings.length) {
  349. newContent += Em.I18n.t('installer.step3.hostWarningsPopup.report.user');
  350. newContent += content.findProperty('category', 'user').warnings.mapProperty('name').join(' ');
  351. }
  352. newContent += '</p>';
  353. return newContent;
  354. }.property('content', 'warningsByHost', 'bodyController.jdkCategoryWarnings', 'bodyController.repoCategoryWarnings', 'bodyController.diskCategoryWarnings', 'bodyController.hostCheckWarnings'),
  355. didInsertElement: function () {
  356. Em.run.next(this, function () {
  357. App.tooltip(this.$("[rel='HostsListTooltip']"), {html: true, placement: "right"});
  358. App.tooltip(this.$('#process .warning-name'), {html: true, placement: "top"});
  359. });
  360. }.observes('content'),
  361. /**
  362. * Show popup with selected hostnames
  363. * @param {object} hosts
  364. * @method showHostsPopup
  365. * @return {App.ModalPopup}
  366. */
  367. showHostsPopup: function (hosts) {
  368. $('.tooltip').hide();
  369. return App.ModalPopup.show({
  370. header: Em.I18n.t('installer.step3.hostWarningsPopup.allHosts'),
  371. bodyClass: Em.View.extend({
  372. hosts: hosts.context,
  373. template: Em.Handlebars.compile('<ul>{{#each host in view.hosts}}<li>{{host}}</li>{{/each}}</ul>')
  374. }),
  375. secondary: null
  376. });
  377. },
  378. /**
  379. * Open/Close selected category
  380. * @param {object} category
  381. * @method onToggleBlock
  382. */
  383. onToggleBlock: function (category) {
  384. this.$('#' + category.context.category).toggle('blind', 500);
  385. category.context.set("isCollapsed", !category.context.get("isCollapsed"));
  386. },
  387. /**
  388. * Generate number of hosts which had warnings, avoid duplicated host names in different warnings.
  389. * @method warningHostsNamesCount
  390. * @return {number}
  391. */
  392. warningHostsNamesCount: function () {
  393. var hostNameMap = Em.Object.create();
  394. if (Em.isNone(this.get('bodyController.warningsByHost'))) return 0;
  395. var warningsByHost = this.get('bodyController.warningsByHost').slice();
  396. warningsByHost.shift();
  397. warningsByHost.forEach(function (_host) {
  398. if (_host.warnings.length) {
  399. hostNameMap[_host.name] = true;
  400. }
  401. });
  402. var repoCategoryWarnings = this.get('bodyController.repoCategoryWarnings');
  403. var diskCategoryWarnings = this.get('bodyController.diskCategoryWarnings');
  404. var jdkCategoryWarnings = this.get('bodyController.jdkCategoryWarnings');
  405. var thpCategoryWarnings = this.get('bodyController.thpCategoryWarnings');
  406. var hostResolutionWarnings = this.get('bodyController.hostCheckWarnings');
  407. if (repoCategoryWarnings.length) {
  408. repoCategoryWarnings[0].hostsNames.forEach(function (_hostName) {
  409. if (!hostNameMap[_hostName]) {
  410. hostNameMap[_hostName] = true;
  411. }
  412. });
  413. }
  414. if (diskCategoryWarnings.length) {
  415. diskCategoryWarnings[0].hostsNames.forEach(function (_hostName) {
  416. if (!hostNameMap[_hostName]) {
  417. hostNameMap[_hostName] = true;
  418. }
  419. });
  420. }
  421. if (jdkCategoryWarnings && jdkCategoryWarnings.length) {
  422. jdkCategoryWarnings[0].hostsNames.forEach(function (_hostName) {
  423. if (!hostNameMap[_hostName]) {
  424. hostNameMap[_hostName] = true;
  425. }
  426. });
  427. }
  428. if (hostResolutionWarnings && hostResolutionWarnings.length) {
  429. hostResolutionWarnings[0].hostsNames.forEach(function (_hostName) {
  430. if (!hostNameMap[_hostName]) {
  431. hostNameMap[_hostName] = true;
  432. }
  433. });
  434. }
  435. if (thpCategoryWarnings.length) {
  436. thpCategoryWarnings[0].hostsNames.forEach(function (_hostName) {
  437. if (!hostNameMap[_hostName]) {
  438. hostNameMap[_hostName] = true;
  439. }
  440. });
  441. }
  442. this.set('hostNamesWithWarnings', Em.keys(hostNameMap));
  443. return Em.keys(hostNameMap).length;
  444. },
  445. /**
  446. * Open new browser tab with detailed content
  447. * @method openWarningsInDialog
  448. */
  449. openWarningsInDialog: function () {
  450. var newWindow = window.open('');
  451. var newDocument = newWindow.document;
  452. newDocument.write(this.get('contentInDetails'));
  453. newWindow.focus();
  454. }
  455. });