PluginProbe
WebTotem Security / 2.3.46
WebTotem Security v2.3.46
3.0.2 3.0.1 3.0.0 trunk 1.0 1.1 1.2 1.3 1.3.1 1.3.2 1.3.3 2.0 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.1 2.2.2 2.2.3 All 110 releases
wt-security / includes / dashboard.php

dashboard.php in WebTotem Security 2.3.46, at includes/dashboard.php

1,169 lines 65.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php defined('ABSPATH') or die("Protected By WT!"); ?>
2
3 <?php if (!empty($arguments)): ?>
4 <div class="wtotem_content">
5 <div class="wtotem_container">
6 <div class="wtotem_first">
7 <div class="wtotem_overall wtotem_first_left wt_card">
8 <div class="wtotem_overall__title wtotem_title-info">
9 <h3 class="wtotem_title-info__title">
10 <?= __( 'Overall Security Grade', 'wtotem' ) ?>
11 <div class="wtotem_title-info__info wtotem-tooltip">
12 <div class="wtotem-tooltip__content">
13 <p class="wtotem-tooltip__header"><?= __( 'Scoring module', 'wtotem' ) ?></p>
14 <p class="wtotem-tooltip__text"><?= __( 'Assesses overall site security, identifies vulnerabilities, misconfigurations, and data leak, as well as gives recommendations for their elimination.', 'wtotem' ) ?></p>
15 </div>
16 </div>
17 </h3>
18 </div>
19 <div class="wtotem_overall__body">
20 <div class="wtotem_overall__inner">
21 <div class="wtotem_overall__rectangle wtsec_score_bg_<?= $arguments["score"]["color"] ?>"><?= $arguments["score"]["grade"] ?></div>
22 <div class="wtotem_overall__figures wtsec_score_<?= $arguments["score"]["color"] ?>"><?= $arguments["score"]["total_score"] ?></div>
23 </div>
24 <p class="wtotem_overall__text"><?= $arguments["score"]["information"] ?></p>
25 </div>
26 </div>
27
28 <div class="wtotem_info wtotem_first_right wt_card">
29 <div class="wtotem_info__item">
30 <div class="wtotem_info__block">
31 <div class="wtotem_info__subtitle"><?= __( 'Tested on:', 'wtotem' ) ?></div>
32 <div class="wtotem_info__info"><?= $arguments["score"]["tested_on"] ?></div>
33 </div>
34 <div class="wtotem_info__block">
35 <div class="wtotem_info__subtitle"><?= __( 'Server Ip:', 'wtotem' ) ?></div>
36 <div class="wtotem_info__info"><?= $arguments["score"]["server_ip"] ?></div>
37 </div>
38 </div>
39 <div class="wtotem_info__item">
40 <div class="wtotem_info__block">
41 <div class="wtotem_info__subtitle"><?= __( 'Location:', 'wtotem' ) ?></div>
42 <div class="wtotem_info__info"><?= $arguments["score"]["location"] ?></div>
43 </div>
44 <div class="wtotem_info__scoring arrow-right">
45 <a href="https://wtotem.com/cabinet/site/<?= $arguments['settings']['site_id']?>/scoring" target="_blank">
46 <?= __('Full scoring', 'wtotem') ?>
47 </a>
48 </div>
49 </div>
50 </div>
51 </div>
52
53 <?php if ($arguments["am"]["process_status"] !== "installed" || !$arguments["am"]["installed"]): ?>
54 <div class="wtotem_unit">
55 <div class="wtotem_unit__first section-header-mb">
56 <h2 class="title">
57 <?= __( 'Agent manager installation', 'wtotem' ) ?>
58 </h2>
59
60 <a class="wtotem_button wtotem_button--primary wtotem_font-700 wtotem_reinstall" href="#" data-text="<?= __( 'Attention, all data will be deleted during the reinstall! Do you want to continue?', 'wtotem' ) ?>">
61 <span><?= __( 'Reinstall agents', 'wtotem' ) ?></span>
62 </a>
63 </div>
64 <div class="wtotem_unit__wrapper wt_card">
65 <?php if ($arguments["am"]["process_status"] === "installing"): ?>
66 <div class="wtotem_unit__block wtotem_unit__block_antivirus" id="wtsec_antivirus_block_installed" style="display: none">
67 <div class="wtotem_unit__contain">
68 <div class="wtotem_unit__circle wtotem_unit__circle_success">
69 <img src="<?= wtsec_getImagePath("success.svg") ?>" alt="Success" class="wtotem_unit__img">
70 </div>
71 <h2 class="title">
72 <?= __( 'Antivirus', 'wtotem' ) ?>
73 </h2>
74 </div>
75 <div class="wtotem_unit__expectation wtotem_unit__expectation_success">
76 <?= __( 'Installed', 'wtotem' ) ?>
77 </div>
78 </div>
79 <div class="wtotem_unit__block wtotem_unit__block_antivirus" id="wtsec_antivirus_block_installing" style="display: none">
80 <div class="wtotem_unit__contain">
81 <div class="wtotem_unit__expectation wtotem_unit__circle_loading">
82 <img src="<?= wtsec_getImagePath("spinner.svg") ?>" alt="Spinner"
83 class="wtotem_unit__img wtotem_unit__img_spinner"/>
84 </div>
85 <h2 class="title ml-2">
86 <?= __( 'Antivirus', 'wtotem' ) ?>
87 </h2>
88 </div>
89 <div class="wtotem_unit__expectation wtotem_unit__expectation_loading">
90 <?= __( 'Installing', 'wtotem' ) ?>...
91 </div>
92 </div>
93 <div class="wtotem_unit__block wtotem_unit__block_antivirus" id="wtsec_antivirus_block_failed" style="display: none">
94 <div class="wtotem_unit__contain">
95 <div class="wtotem_unit__circle wtotem_unit__circle_error"></div>
96 <h2 class="title">
97 <?= __( 'Antivirus', 'wtotem' ) ?>
98 </h2>
99 </div>
100 <div class="wtotem_unit__expectation wtotem_unit__expectation_error">
101 <?= __( 'Failed to install', 'wtotem' ) ?>
102 </div>
103 </div>
104
105 <div class="wtotem_unit__block wtotem_unit__block_firewall" id="wtsec_firewall_block_installed" style="display: none">
106 <div class="wtotem_unit__contain">
107 <div class="wtotem_unit__circle wtotem_unit__circle_success">
108 <img src="<?= wtsec_getImagePath("success.svg") ?>" alt="Success"
109 class="wtotem_unit__img">
110 </div>
111 <h2 class="title">
112 <?= __( 'Firewall', 'wtotem' ) ?>
113 </h2>
114 </div>
115 <div class="wtotem_unit__expectation wtotem_unit__expectation_success">
116 <?= __( 'Installed', 'wtotem' ) ?>
117 </div>
118 </div>
119
120 <div class="wtotem_unit__block wtotem_unit__block_firewall" id="wtsec_firewall_block_installing" style="display: none">
121 <div class="wtotem_unit__contain">
122 <div class="wtotem_unit__expectation wtotem_unit__circle_loading">
123 <img src="<?= wtsec_getImagePath("spinner.svg") ?>" alt="Spinner"
124 class="wtotem_unit__img wtotem_unit__img_spinner"/>
125 </div>
126 <h2 class="title ml-2">
127 <?= __( 'Firewall', 'wtotem' ) ?>
128 </h2>
129 </div>
130 <div class="wtotem_unit__expectation wtotem_unit__expectation_loading">
131 <?= __( 'Installing', 'wtotem' ) ?>...
132 </div>
133 </div>
134
135 <div class="wtotem_unit__block wtotem_unit__block_firewall" id="wtsec_firewall_block_failed" style="display: none">
136 <div class="wtotem_unit__contain">
137 <div class="wtotem_unit__circle wtotem_unit__circle_error"></div>
138 <h2 class="title">
139 <?= __( 'Firewall', 'wtotem' ) ?>
140 </h2>
141 </div>
142 <div class="wtotem_unit__expectation wtotem_unit__expectation_error">
143 <?= __( 'Failed to install', 'wtotem' ) ?>
144 </div>
145 </div>
146 <?php elseif(!$arguments["am"]["installed"]): ?>
147 <div class="wtotem_unit__block">
148 <div class="wtotem_unit__contain">
149 <div class="wtotem_unit__circle wtotem_unit__circle_error"></div>
150 <h2 class="title">
151 <?= __( 'Failed to install Agent Manager', 'wtotem' ) ?>
152 </h2>
153 </div>
154 <div class="wtotem_unit__expectation wtotem_unit__expectation_error">
155 <a class="wtotem_button wtotem_button--primary wtotem_font-700 wtotem_block_center wtotem_reinstall" href="#" data-text="<?= __( 'Attention, all data will be deleted during the reinstall! Do you want to continue?', 'wtotem' ) ?>">
156 <span><?= __( 'Install', 'wtotem' ) ?></span>
157 </a>
158 </div>
159 </div>
160 <?php endif; ?>
161
162 </div>
163
164 </div>
165 <?php endif; ?>
166
167
168 <div class="wtotem_firewall">
169 <div class="wtotem_firewall__first section-header-mb">
170 <h2 class="title"><?= __( 'Firewall activity', 'wtotem' ) ?></h2>
171 </div>
172
173 <?php if($arguments["wafTraining"]):?>
174 <div class="wtotem_firwall-training-alert wt_card">
175 <div class="wtotem_firwall-training-alert__text-wrapper">
176 <p class="wtotem_firwall-training-alert__text">
177 <?= __( 'Firewall needs up to 2 days to finish training', 'wtotem' ) ?>
178 </p>
179 </div>
180 <a href="https://docs.wtotem.com/SpHJ-firewall" target="_blank" class="wtotem_firwall-training-alert__learn-more button">
181 <?= __( 'Show more', 'wtotem' ) ?>
182 </a>
183 </div>
184 <?php endif; ?>
185
186 <div class="wtotem_firewall__block">
187 <div class="wtotem_numbers wt_card">
188 <div class="wtotem_numbers__item">
189 <div class="wtotem_numbers__title"><?= __( 'Attacks', 'wtotem' ) ?></div>
190 <div class="wtotem_numbers__figures"><?= $arguments["waf"]["attacks"] ?></div>
191 </div>
192
193 <div class="wtotem_numbers__item">
194 <div class="wtotem_numbers__title"><?= __( 'Attacks blocked', 'wtotem' ) ?></div>
195 <div class="wtotem_numbers__figures"><?= $arguments["waf"]["blocking"] ?></div>
196 </div>
197
198 <div class="wtotem_numbers__item">
199 <div class="wtotem_numbers__title"><?= __( 'Not blocked', 'wtotem' ) ?></div>
200 <div class="wtotem_numbers__figures"><?= $arguments["waf"]["non-blocking"] ?></div>
201 </div>
202 </div>
203
204
205 <div class="wtotem_from wt_card">
206 <div class="wtotem_from__svg-wrap">
207 <svg class="wtotem_from__progress">
208 <circle class="wtotem_from__circle" cx="35" cy="35" r="28" stroke-width="20" stroke="rgb(135,255,222)"/>
209 </svg>
210 <span class="wtotem_from__percent" data-value="<?=$arguments["waf"]["countryAttacks"]['percent']?>">100%</span>
211 </div>
212
213 <div class="wtotem_from__info">
214 <div class="wtotem_from__title"><?= __( 'Country', 'wtotem' ) ?></div>
215 <div class="wtotem_from__country" >
216 <?= ($arguments["waf"]["countryAttacks"]["country"]) ?
217 __( 'Attack from', 'wtotem' ) . ' <span>'. $arguments["waf"]["countryAttacks"]["country"].'</span>' :
218 __( 'Pending', 'wtotem' ) ?>
219 </div>
220 </div>
221 <?php if(wtsec_app()->get('waf_installed')): ?>
222 <a href="<?=wtsec_getUrl("waf")?>" class="wtotem_from__arrow-right"></a>
223 <?php endif; ?>
224 </div>
225 </div>
226 </div>
227
228 <div class="wtotem_chart wt_card">
229 <div class="wtotem_chart-first">
230 <div class="wtotem_chart-first__left">
231 <div class="wtotem_chart-first__hack wtotem_chart-first__hack_attack">
232 <span></span>
233 <p><?= __( 'Attacks', 'wtotem' ) ?></p>
234 </div>
235 <div class="wtotem_chart-first__hack wtotem_chart-first__hack_blocked">
236 <span></span>
237 <p><?= __( 'Blocked', 'wtotem' ) ?></p>
238 </div>
239 </div>
240
241 <div class="wtotem_chart-first__right chart_btn" data-box="chart_wrap" data-service="waf">
242 <div class="wtotem_chart-first__btn" data-days="365"><?= __( 'Yearly', 'wtotem' ) ?></div>
243 <div class="wtotem_chart-first__btn" data-days="31"><?= __( 'Monthly', 'wtotem' ) ?></div>
244 <div class="wtotem_chart-first__btn wtotem_chart-first__btn_active" data-days="7"><?= __( 'Weekly', 'wtotem' ) ?></div>
245 <div class="wtotem_chart-first__btn" data-days="1"><?= __( 'Daily', 'wtotem' ) ?></div>
246 </div>
247 </div>
248
249 <?php if($arguments["waf"]["chart"] && $arguments["waf"]["chart"] != 'null'):?>
250 <div id="chart_wrap">
251 <div class="wtotem_chart__diagram" data-days="31" id="wtotem_chart_diagram">
252 <div id="line-chart" class="line-chart">
253 <div id="tooltipAttacks" class="line-chart__tooltip">
254 <span id="countAttacks"></span>
255 </div>
256 <div id="tooltipBlocked" class="line-chart__tooltip line-chart__tooltip--reverse">
257 <span id="countBlocked"></span>
258 </div>
259 </div>
260 </div>
261
262 <div class="wtotem_chart__line"></div>
263 </div>
264 <?php else:?>
265 <!-- No data block -->
266 <section class="wtotem_reports-no-data" style="height:300px" >
267 <h2 class="visually-hidden"><?= __( 'No data', 'wtotem' ) ?></h2>
268 <p class="wtotem_reports-no-data__text">
269 <?= __( 'Has no action ready yet', 'wtotem' ) ?>
270 </p>
271 </section>
272 <?php endif; ?>
273
274 <?php if($arguments['waf']['edges']):?>
275 <div class="wtotem_data">
276 <div class="wtotem_data__thead">
277 <div class="wtotem_data__tr">
278 <div class="wtotem_data__th wtotem_data_width_1">
279 <?= __( 'Type/IP', 'wtotem' ) ?>
280 </div>
281 <div class="wtotem_data__th wtotem_data_width_2">
282 <?= __( 'Country', 'wtotem' ) ?>
283 </div>
284 <div class="wtotem_data__th wtotem_data_width_3">
285 <?= __( 'Time', 'wtotem' ) ?>
286 </div>
287 <div class="wtotem_data__th wtotem_data_width_4">
288 <?= __( 'Attack location', 'wtotem' ) ?>
289 </div>
290 <div class="wtotem_data__th wtotem_data_width_6">
291 <?= __( 'Status', 'wtotem' ) ?>
292 </div>
293 </div>
294 </div>
295 <div class="wtotem_data__tbody">
296 <?php include 'components/_firewall_lazy.php'?>
297 </div>
298 </div>
299 <?php endif; ?>
300 <div class="wtotem_chart__line"></div>
301 <div class="wtotem_chart__last">
302
303 <?php if(wtsec_app()->get('waf_installed')): ?>
304 <a href="<?=wtsec_getUrl("waf")?>" class="wtotem_chart__btn">
305 <?= __( 'Show more', 'wtotem' ) ?>
306 </a>
307 <?php endif; ?>
308 </div>
309 </div>
310
311 <div class="wtotem_map__first section-header-mb">
312 <h2 class="title"><?= __( 'Server resources', 'wtotem' ) ?>
313 <div class="wtotem_title-info__info wtotem-tooltip">
314 <div class="wtotem-tooltip__content">
315 <p class="wtotem-tooltip__header"><?= __( 'Server resources', 'wtotem' ) ?></p>
316 <p class="wtotem-tooltip__text"><?= __( 'Displays critical data about web-server usage. A large load on a server can slow down the website performance.', 'wtotem' ) ?></p>
317 </div>
318 </div>
319 </h2>
320
321 </div>
322
323 <!-- RAM diagram -->
324 <div class="wtotem_chart wt_card">
325 <div class="wtotem_chart-first">
326 <div class="wtotem_chart-first__left">
327 <h3><?= __( 'Random access memory', 'wtotem' ) ?>
328 <div class="wtotem_title-info__info wtotem-tooltip">
329 <div class="wtotem-tooltip__content">
330 <p class="wtotem-tooltip__header"><?= __( 'RAM', 'wtotem' ) ?></p>
331 <p class="wtotem-tooltip__text"><?= __( 'Shows the RAM load.', 'wtotem' ) ?></p>
332 </div>
333 </div>
334 </h3>
335 </div>
336 <div class="wtotem_chart-first__right chart_btn" data-box="chart_ram_wrap" data-service="ram">
337 <div class="wtotem_chart-first__btn" data-days="365"><?= __( 'Yearly', 'wtotem' ) ?></div>
338 <div class="wtotem_chart-first__btn" data-days="31"><?= __( 'Monthly', 'wtotem' ) ?></div>
339 <div class="wtotem_chart-first__btn wtotem_chart-first__btn_active" data-days="7"><?= __( 'Weekly', 'wtotem' ) ?></div>
340 <div class="wtotem_chart-first__btn" data-days="1"><?= __( 'Daily', 'wtotem' ) ?></div>
341 </div>
342 </div>
343
344 <?php if($arguments["serverStatus"]["ramChart"] && $arguments["serverStatus"]["ramChart"] != 'null'):?>
345 <div id="chart_ram_wrap">
346 <div class="wtotem_chart__diagram">
347 <div id="ram-chart" class="line-chart" data-days="7">
348 <div id="tooltipRam" class="line-chart__tooltip">
349 <span id="countRam"></span>
350 </div>
351 </div>
352 </div>
353 <div class="wtotem_chart__line"></div>
354 </div>
355
356 <?php else:?>
357
358 <!-- No data block -->
359 <section class="wtotem_reports-no-data" style="height:300px" >
360 <h2 class="visually-hidden"><?= __( 'No data', 'wtotem' ) ?></h2>
361 <p class="wtotem_reports-no-data__text">
362 <?= __( 'No data', 'wtotem' ) ?>
363 </p>
364 </section>
365
366 <?php endif; ?>
367
368 <section class="wtotem-ss-info">
369 <h3 class="visually-hidden"></h3>
370 <dl class="wtotem-ss-info__stats-list">
371 <div class="wtotem-ss-info__column">
372 <div class="wtotem-ss-info__stat-wrapper">
373 <dt>PHP version</dt>
374 <dd><?= $arguments['serverStatus']['info']['phpVersion']?></dd>
375 </div>
376 <div class="wtotem-ss-info__stat-wrapper">
377 <dt>PHP Server User</dt>
378 <dd><?= $arguments['serverStatus']['info']['phpServerUser']?></dd>
379 </div>
380 <div class="wtotem-ss-info__stat-wrapper">
381 <dt>Operation system</dt>
382 <dd title="<?= $arguments['serverStatus']['info']['osInfo']?>">
383 <?= wtsec_cutString($arguments['serverStatus']['info']['osInfo'],20)?>
384 </dd>
385 </div>
386 </div>
387 <div class="wtotem-ss-info__column">
388 <div class="wtotem-ss-info__stat-wrapper">
389 <dt>CPU Freq</dt>
390 <dd><?= $arguments['serverStatus']['info']['CpuFreq']?> MHz</dd>
391 </div>
392 <div class="wtotem-ss-info__stat-wrapper">
393 <dt>CPU count</dt>
394 <dd><?= $arguments['serverStatus']['info']['cpuCount']?></dd>
395 </div>
396 <div class="wtotem-ss-info__stat-wrapper">
397 <dt>CPU Model</dt>
398 <dd title="<?= $arguments['serverStatus']['info']['cpuModel']?>">
399 <?= wtsec_cutString($arguments['serverStatus']['info']['cpuModel'],20)?>
400 </dd>
401 </div>
402 </div>
403 <div class="wtotem-ss-info__column">
404 <div class="wtotem-ss-info__stat-wrapper">
405 <dt>CPU Family</dt>
406 <dd><?= $arguments['serverStatus']['info']['cpuFamily']?></dd>
407 </div>
408
409 </div>
410 </dl>
411 </section>
412
413 </div>
414
415 <!-- CPU diagram -->
416 <div class="wtotem_chart wt_card">
417 <div class="wtotem_chart-first">
418 <div class="wtotem_chart-first__left">
419 <h3><?= __( 'CPU Load average', 'wtotem' ) ?>
420 <div class="wtotem_title-info__info wtotem-tooltip">
421 <div class="wtotem-tooltip__content">
422 <p class="wtotem-tooltip__header"><?= __( 'CPU Load average', 'wtotem' ) ?></p>
423 <p class="wtotem-tooltip__text"><?= __( 'Shows the CPU load.', 'wtotem' ) ?></p>
424 </div>
425 </div>
426 </h3>
427 </div>
428 <div class="wtotem_chart-first__right chart_btn" data-box="chart_cpu_wrap" data-service="cpu">
429 <div class="wtotem_chart-first__btn" data-days="365"><?= __( 'Yearly', 'wtotem' ) ?></div>
430 <div class="wtotem_chart-first__btn" data-days="31"><?= __( 'Monthly', 'wtotem' ) ?></div>
431 <div class="wtotem_chart-first__btn wtotem_chart-first__btn_active" data-days="7"><?= __( 'Weekly', 'wtotem' ) ?></div>
432 <div class="wtotem_chart-first__btn" data-days="1"><?= __( 'Daily', 'wtotem' ) ?></div>
433 </div>
434 </div>
435
436 <?php if($arguments["serverStatus"]["cpuChart"] && $arguments["serverStatus"]["cpuChart"] != 'null'):?>
437 <div id="chart_cpu_wrap">
438 <div class="wtotem_chart__diagram">
439 <div id="cpu-chart" class="line-chart" data-days="7">
440 <div id="tooltipCpu" class="line-chart__tooltip">
441 <span id="countCpu"></span>
442 </div>
443 </div>
444 </div>
445 </div>
446 <?php else:?>
447 <!-- No data block -->
448 <section class="wtotem_reports-no-data" style="height:300px" >
449 <h2 class="visually-hidden"><?= __( 'No data', 'wtotem' ) ?></h2>
450 <p class="wtotem_reports-no-data__text">
451 <?= __( 'No data', 'wtotem' ) ?>
452 </p>
453 </section>
454 <?php endif; ?>
455 </div>
456
457 <div class="wtotem_antivirus">
458 <div class="wtotem_antivirus__first section-header-mb">
459 <h2 class="title">
460 <?= __( 'Antivirus', 'wtotem' ) ?>
461 </h2>
462 <?php if(wtsec_app()->get('av_installed')): ?>
463 <a href="<?=wtsec_getUrl("vc")?>" class="arrow-right">
464 <?= __( 'Show more', 'wtotem' ) ?>
465 </a>
466 <?php endif; ?>
467 </div>
468 <div class="wtotem_antivirus__block wt_card">
469 <div class="wtotem_antivirus__item">
470 <div class="wtotem_antivirus__figures wtotem_antivirus__figures_green">
471 <?= $arguments["vc"]["scanned"] ?>
472 </div>
473 <div class="wtotem_antivirus__title">
474 <?= __( 'Scanned files', 'wtotem' ) ?>
475 </div>
476 </div>
477
478 <div class="wtotem_antivirus__item">
479 <div class="wtotem_antivirus__figures wtotem_antivirus__figures_yellow">
480 <?= $arguments["vc"]["changes"] ?>
481 </div>
482 <div class="wtotem_antivirus__title">
483 <?= __( 'Changed files', 'wtotem' ) ?>
484 </div>
485 </div>
486
487 <div class="wtotem_antivirus__item">
488 <div class="wtotem_antivirus__figures wtotem_antivirus__figures_black">
489 <?= $arguments["vc"]["deleted"] ?>
490 </div>
491 <div class="wtotem_antivirus__title">
492 <?= __( 'Deleted files', 'wtotem' ) ?>
493 </div>
494 </div>
495
496 <div class="wtotem_antivirus__item">
497 <div class="wtotem_antivirus__figures wtotem_antivirus__figures_orange">
498 <?= $arguments["vc"]["signatures"] ?>
499 </div>
500 <div class="wtotem_antivirus__title">
501 <?= __( 'Infected files', 'wtotem' ) ?>
502 </div>
503 </div>
504
505 </div>
506 </div>
507
508 <div class="wtotem_monitoring">
509 <div class="wtotem_monitoring__first section-header-mb">
510 <h2 class="title">
511 <?= __( 'Monitoring', 'wtotem' ) ?>
512 </h2>
513 </div>
514 <div class="wtotem_table wt_card">
515 <div class="wtotem_table__row">
516 <div class="wtotem_table__col">
517 <div class="wtotem_table__th">
518 <h3 class="wtotem_table__title wtotem_title-info__title">
519 <?= __( 'SSL', 'wtotem' ) ?>
520 <div class="wtotem_title-info__info wtotem-tooltip">
521 <div class="wtotem-tooltip__content">
522 <p class="wtotem-tooltip__header"><?= __( 'SSL module', 'wtotem' ) ?></p>
523 <p class="wtotem-tooltip__text"><?= __( 'Displays the status of the SSL Certificate.', 'wtotem' ) ?></p>
524 </div>
525 </div>
526 </h3>
527 </div>
528
529 <?php if($arguments["ssl"]["status"]['type'] == 'pending'):?>
530 <?php include 'components/_dots_loader.php'?>
531 <?php else: ?>
532 <div class="wtotem_table__td">
533 <div class="wtotem_table__expired">
534 <?= $arguments["ssl"]["status"]["text"] ?>
535 </div>
536 </div>
537
538 <?php if (!empty($arguments["ssl"]["days_left"])): ?>
539 <div class="wtotem_table__info">
540 <h3 class="wtotem_table__subject">
541 <?= __( 'Days left', 'wtotem' ) ?>
542 </h3>
543 <div class="wtotem_table__text">
544 <?= $arguments["ssl"]["days_left"] ?>
545 </div>
546 </div>
547 <?php endif; ?>
548 <?php if (!empty($arguments["ssl"]["issue_date"])): ?>
549 <div class="wtotem_table__info">
550 <h3 class="wtotem_table__subject">
551 <?= __( 'Issue date', 'wtotem' ) ?>
552 </h3>
553 <div class="wtotem_table__text">
554 <?= $arguments["ssl"]["issue_date"] ?>
555 </div>
556 </div>
557 <?php endif; ?>
558 <?php if (!empty($arguments["ssl"]["expiry_date"])): ?>
559 <div class="wtotem_table__info">
560 <h3 class="wtotem_table__subject">
561 <?= __( 'Expiry date', 'wtotem' ) ?>
562 </h3>
563 <div class="wtotem_table__text">
564 <?= $arguments["ssl"]["expiry_date"] ?>
565 </div>
566 </div>
567 <?php endif; ?>
568
569 <?php endif; ?>
570 </div>
571 <div class="wtotem_table__col">
572 <div class="wtotem_table__th">
573 <h3 class="wtotem_table__title wtotem_title-info__title">
574 <?= __( 'Availability', 'wtotem' ) ?>
575 <div class="wtotem_title-info__info wtotem-tooltip">
576 <div class="wtotem-tooltip__content">
577 <p class="wtotem-tooltip__header"><?= __( 'Availability module', 'wtotem' ) ?></p>
578 <p class="wtotem-tooltip__text"><?= __( 'Check the performance of your site every minute. Stay informed about the problems of accessibility of the site instantly using any available types of notifications: SMS, Email, Telegram, Slack and many others.', 'wtotem' ) ?></p>
579 </div>
580 </div>
581 </h3>
582 </div>
583
584 <?php if($arguments["wa"]["status"]['type'] == 'pending'):?>
585 <?php include 'components/_dots_loader.php'?>
586 <?php else: ?>
587 <div class="wtotem_table__td">
588 <div class="wtotem_table__perfomance">
589 <?= __( 'Performance', 'wtotem' ) ?>
590 </div>
591 <div class="wtotem_table__right wtotem_table__right_progress-wrap">
592 <span class="wtotem_table__initial-value">0%</span>
593 <div class="wtotem_table__stick-progress">
594 <div class="wtotem_table__message">
595 <span class="wtotem_table__percent">
596 <?= $arguments["wa"]["availability_percent"] ?>%
597 </span>
598 <span class="wtotem_table__triangle"></span>
599 </div>
600 </div>
601 </div>
602 </div>
603 <div class="wtotem_table__info">
604 <h3 class="wtotem_table__subject">
605 <?= __( 'Status', 'wtotem' ) ?>
606 <div class="wtotem_title-info__info wtotem-tooltip">
607 <div class="wtotem-tooltip__content">
608 <?= (array_key_exists($arguments["wa"]["status"]["type"],$arguments['tooltipsStatuses'])) ? $arguments['tooltipsStatuses'][$arguments["wa"]["status"]["type"]] : '' ?>
609 </div>
610 </div>
611 </h3>
612 <div class="wtotem_table__status"><?= $arguments["wa"]["status"]["text"] ?></div>
613 </div>
614 <div class="wtotem_table__info">
615 <h3 class="wtotem_table__subject"><?= __( 'Response time', 'wtotem' ) ?></h3>
616 <div class="wtotem_table__text"><?= $arguments["wa"]["response_time"] ?></div>
617 </div>
618 <div class="wtotem_table__info">
619 <h3 class="wtotem_table__subject"><?= __( 'Downtime', 'wtotem' ) ?></h3>
620 <div class="wtotem_table__text"><?= $arguments["wa"]["downtime"] ?></div>
621 </div>
622 <div class="wtotem_table__info">
623 <h3 class="wtotem_table__subject"><?= __( 'Last test', 'wtotem' ) ?></h3>
624 <div class="wtotem_table__text"><?= $arguments["wa"]["last_test"] ?></div>
625 </div>
626 <?php endif; ?>
627 </div>
628
629 <div class="wtotem_table__col">
630 <div class="wtotem_table__th">
631 <h3 class="wtotem_table__title wtotem_title-info__title"><?= __( 'Reputation', 'wtotem' ) ?>
632 <div class="wtotem_title-info__info wtotem-tooltip">
633 <div class="wtotem-tooltip__content">
634 <p class="wtotem-tooltip__header"><?= __( 'Reputation module', 'wtotem' ) ?></p>
635 <p class="wtotem-tooltip__text"><?= __( 'Checks website entries in 60+ blacklisting authorities.', 'wtotem' ) ?></p>
636 </div>
637 </div>
638 </h3>
639 </div>
640
641 <?php if($arguments["av"]["status"]['type'] == 'pending'):?>
642 <?php include 'components/_dots_loader.php'?>
643 <?php else: ?>
644
645 <div class="wtotem_table__td">
646 <div class="wtotem_table__wrap">
647 <?php if($arguments["av"]["status"]["image"]):?>
648 <img src="<?= wtsec_getImagePath($arguments["av"]["status"]["image"]) ?>" alt="Check mark icon"
649 class="wtotem_table__img"/>
650 <?php endif; ?>
651 </div>
652
653 <div class="wtotem_table__perfomance wtotem_table__perfomance_long ml-2"><?= $arguments["av"]["reputation"] ?></div>
654 </div>
655 <div class="wtotem_table__info">
656 <h3 class="wtotem_table__subject">
657 <?= __( 'Status', 'wtotem' ) ?>
658 <div class="wtotem_title-info__info wtotem-tooltip">
659 <div class="wtotem-tooltip__content">
660 <?= (array_key_exists($arguments["av"]["status"]["type"],$arguments['tooltipsStatuses'])) ? $arguments['tooltipsStatuses'][$arguments["av"]["status"]["type"]] : '' ?>
661 </div>
662 </div>
663 </h3>
664 <div class="wtotem_table__status"><?= $arguments["av"]["status"]["text"] ?></div>
665 </div>
666 <div class="wtotem_table__info">
667 <h3 class="wtotem_table__subject">
668 <?= __( 'Deny lists entries', 'wtotem' ) ?>
669 </h3>
670 <div class="wtotem_table__text">
671 <?= $arguments["av"]["blacklists_entries"] ?>
672 </div>
673 </div>
674 <div class="wtotem_table__info">
675 <h3 class="wtotem_table__subject">
676 <?= __( 'Last test', 'wtotem' ) ?>
677 </h3>
678 <div class="wtotem_table__text">
679 <?= $arguments["av"]["time_of_the_last_test"] ?>
680 </div>
681 </div>
682 <div class="wtotem_table__info"></div>
683
684 <?php endif; ?>
685 </div>
686 </div>
687 <div class="wtotem_table__footer">
688 <a target="_blank" href="https://wtotem.com/faq/#hs-chat-open" class="wtotem_table__link">
689 <div class="wtotem_table__perfomance">
690 <?= __( 'Need more support?', 'wtotem' ) ?>
691 <span><?= __( 'Let\'s talk!', 'wtotem' ) ?></span>
692 </div>
693 </a>
694 </div>
695 </div>
696 </div>
697
698 <div class="wtotem_scanning">
699 <div class="wtotem_scanning__first section-header-mb">
700 <h2 class="title">
701 <?= __( 'Scanning', 'wtotem' ) ?>
702 </h2>
703 </div>
704 <div class="wtotem_table wt_card">
705 <div class="wtotem_table__row">
706 <div class="wtotem_table__col">
707 <div class="wtotem_table__th">
708 <h3 class="wtotem_table__title wtotem_title-info__title">
709 <?= __( 'Port scanner', 'wtotem' ) ?>
710 <div class="wtotem_title-info__info wtotem-tooltip">
711 <div class="wtotem-tooltip__content">
712 <p class="wtotem-tooltip__header"><?= __( 'Port scanner', 'wtotem' ) ?></p>
713 <p class="wtotem-tooltip__text"><?= __( 'Detects open ports on the server. Potentially, open ports can be dangerous and used by hackers.', 'wtotem' ) ?> </p>
714 </div>
715 </div>
716 </h3>
717 </div>
718 <?php if($arguments["ps"]["status"]['type'] == 'pending'):?>
719 <?php include 'components/_dots_loader.php'?>
720 <?php else: ?>
721 <div class="wtotem_table__info">
722 <h3 class="wtotem_table__subject">
723 <?= __( 'Status', 'wtotem' ) ?>
724 <div class="wtotem_title-info__info wtotem-tooltip">
725 <div class="wtotem-tooltip__content">
726 <?= (array_key_exists($arguments["ps"]["status"]["type"],$arguments['tooltipsStatuses'])) ? $arguments['tooltipsStatuses'][$arguments["ps"]["status"]["type"]] : '' ?>
727 </div>
728 </div>
729 </h3>
730 <div class="wtotem_table__status"><?= $arguments["ps"]["status"]["text"] ?></div>
731 </div>
732 <div class="wtotem_table__info">
733 <h3 class="wtotem_table__subject"><?= __( 'IP Address', 'wtotem' ) ?></h3>
734 <div class="wtotem_table__text"><?= $arguments["ps"]["ip"] ?></div>
735 </div>
736 <div class="wtotem_table__info">
737 <h3 class="wtotem_table__subject">
738 <?= __( 'TCP', 'wtotem' ) ?>
739 </h3>
740 <div class="wtotem_table__text">
741
742 <div class="wt-stats__value port-scanner-ports">
743 <div class="port-scanner-ports-wrap">
744 <?php if(!empty($arguments["ps"]["tcp"])): ?>
745 <?php foreach ($arguments["ps"]["tcp"] as $port):?>
746 <span class="port-scanner-port-wrapper"><?= $port ?>
747 <div class="port-scanner-icon wtotem-port-add" data-port="<?= $port ?>">
748 <img width="10px" height="10px" src="<?= wtsec_getImagePath("plus_white.svg") ?>" class="svg-icon">
749 </div>
750 </span>
751 <?php endforeach; ?>
752 <?php endif; ?>
753 </div>
754
755 <span class="port-scanner-port-wrapper" id="wtotem_ps_settings">
756 <img width="18px" height="18px" src="<?= wtsec_getImagePath("settings_icon.svg") ?>" class="svg-icon">
757 </span>
758 </div>
759 </div>
760 </div>
761 <div class="wtotem_table__info">
762 <h3 class="wtotem_table__subject">
763 <?= __( 'Last test', 'wtotem' ) ?>
764 </h3>
765 <div class="wtotem_table__text">
766 <?= $arguments["ps"]["last_test"] ?>
767 </div>
768 </div>
769
770
771 <div class="popup-overlay d-none">
772 <div class="popup-content wt_card">
773 <div class="wt-spinner d-none wt-ps-config-spinner"><img src="<?= wtsec_getImagePath("spinner.svg") ?>" alt="spinner"></div>
774 <div class="port-scanner-list">
775 <div class="port-scanner-list__header">
776 <div class="port-scanner-list__header--title"><?= __( 'Port scanner deny list', 'wtotem' ) ?></div>
777 <div class="port-scanner-list__header--close popup-overlay__close">
778 <img width="10px" height="10px" src="<?= wtsec_getImagePath("plus_dark.svg") ?>" class="svg-icon">
779 </div>
780 </div>
781 <div class="port-scanner-list__form">
782 <span><?= __( 'Open ports', 'wtotem' ) ?></span>
783 <div class="port-scanner-list__form-ports">
784
785 <?php if (!empty($arguments["ps"]["tcp"])): ?>
786 <?php foreach ($arguments["ps"]["tcp"] as $port):?>
787 <span class="port-scanner-port-wrapper"><?= $port ?>
788 <div class="port-scanner-icon wtotem-port-add" data-port="<?= $port ?>">
789 <img width="10px" height="10px" src="<?= wtsec_getImagePath("plus_white.svg") ?>" class="svg-icon">
790 </div>
791 </span>
792 <?php endforeach; ?>
793 <?php endif; ?>
794 </div>
795
796 <div class="port-scanner-list__form-input">
797 <div class="wt-input">
798 <form class="port-scanner-list__form" action="">
799 <div class="wt-input__inner wt-input__inner--with-icon">
800 <input placeholder="<?= __( 'Type port number', 'wtotem' ) ?>" id="wtotem-input-port" type="number" min="0" max="65536" value="">
801 <div class="wt-input__icon">
802 <div class="port-scanner-list__form-input-icon">
803 <div class="wt-icon">
804 <input type="image" src="<?= wtsec_getImagePath("plus_dark.svg") ?>" alt="<?= __( 'send', 'wtotem' ) ?>" class="svg-icon">
805 </div>
806 </div>
807 </div>
808 </div>
809 </form>
810 <p class="wtotem-input-port__info"></p>
811 </div>
812 </div>
813 </div>
814
815 <div class="port-scanner-list__wrap">
816 <?php if (!empty($arguments["ps"]["ignorePorts"])): ?>
817 <div class="port-scanner-list__table">
818 <table>
819 <thead>
820 <tr>
821 <td><?= __( 'Port', 'wtotem' ) ?></td>
822 <td><?= __( 'Action', 'wtotem' ) ?></td>
823 </tr>
824 </thead>
825 <tbody>
826 <?php foreach ($arguments["ps"]["ignorePorts"] as $port):?>
827 <tr>
828 <td><span><?= $port ?></span></td>
829 <td>
830 <div class="wtotem-port-remove" data-port="<?= $port ?>">
831 <?= __( 'Remove', 'wtotem' ) ?>
832 </div>
833 </td>
834 </tr>
835 <?php endforeach; ?>
836 </tbody>
837 </table>
838 </div>
839 <?php endif; ?>
840 </div>
841
842 </div>
843 </div>
844 </div>
845
846 <?php endif; ?>
847 </div>
848
849 <div class="wtotem_table__col">
850 <div class="wtotem_table__th">
851 <h3 class="wtotem_table__title wtotem_title-info__title">
852 <?= __( 'Deface scanner', 'wtotem' ) ?>
853 <div class="wtotem_title-info__info wtotem-tooltip">
854 <div class="wtotem-tooltip__content">
855 <p class="wtotem-tooltip__header"><?= __( 'Deface scanner', 'wtotem' ) ?></p>
856 <p class="wtotem-tooltip__text"><?= __( 'Tracks the possible hacker attack with the main page substitution.', 'wtotem' ) ?></p>
857 </div>
858 </div>
859 </h3>
860 </div>
861
862 <?php if($arguments["dc"]["status"]['type'] == 'pending'):?>
863 <?php include 'components/_dots_loader.php'?>
864 <?php else: ?>
865
866 <div class="wtotem_table__item">
867 <div class="wtotem_table__wrap_big">
868 <?php if($arguments["dc"]["status"]["image"]):?>
869 <img src="<?= wtsec_getImagePath($arguments["dc"]["status"]["image"]) ?>" alt="Check mark icon"
870 class="wtotem_table__img"/>
871 <?php endif; ?>
872 </div>
873 </div>
874
875 <div class="wtotem_table__info">
876 <h3 class="wtotem_table__subject">
877 <?= __( 'Status', 'wtotem' ) ?>
878 <div class="wtotem_title-info__info wtotem-tooltip">
879 <div class="wtotem-tooltip__content">
880 <?= (array_key_exists($arguments["dc"]["status"]["type"],$arguments['tooltipsStatuses'])) ? $arguments['tooltipsStatuses'][$arguments["dc"]["status"]["type"]] : '' ?>
881 </div>
882 </div>
883 </h3>
884 <div class="wtotem_table__status">
885 <?= $arguments["dc"]["status"]["text"] ?>
886 </div>
887 </div>
888 <?php if($arguments["dc"]["words"]):?>
889 <div class="wtotem_table__info">
890 <h3 class="wtotem_table__subject">
891 <?= __( 'Found words', 'wtotem' ) ?>
892 </h3>
893 <div class="wtotem_table__text">
894 <?= $arguments["dc"]["words"] ?>
895 </div>
896 </div>
897 <?php endif; ?>
898 <div class="wtotem_table__info">
899 <h3 class="wtotem_table__subject">
900 <?= __( 'Last test', 'wtotem' ) ?>
901 </h3>
902 <div class="wtotem_table__text">
903 <?= $arguments["dc"]["time_of_the_last_test"] ?>
904 </div>
905 </div>
906
907 <?php endif; ?>
908 </div>
909
910 <div class="wtotem_table__col">
911 <section class="wtotem-ss-disc">
912 <div class="wtotem_chart wt_card wtotem-ss-disc">
913 <div class="wtotem_chart-first wtotem-ss-disc__header">
914 <h3 class="wtotem_table__subject" ><?= __( 'DISC USAGE', 'wtotem' ) ?>
915 <div class="wtotem_title-info__info wtotem-tooltip">
916 <div class="wtotem-tooltip__content">
917 <p class="wtotem-tooltip__header"><?= __( 'Disc usage', 'wtotem' ) ?></p>
918 <p class="wtotem-tooltip__text"><?= __( 'Shows the Disc load and its accessible memory.', 'wtotem' ) ?></p>
919 </div>
920 </div>
921 </h3>
922 </div>
923 <div class="wtotem_state__line wtotem-ss-disc__line"></div>
924
925 <div class="wtotem-ss-disc__content">
926 <?php if(!$arguments["serverStatus"]["discUsage"]['total']):?>
927 <section class="wtotem_reports-no-data" >
928 <h2 class="visually-hidden"><?= __( 'No data', 'wtotem' ) ?></h2>
929 <p class="wtotem_reports-no-data__text">
930 <?= __( 'No data', 'wtotem' ) ?>
931 </p>
932 </section>
933 <?php else: ?>
934 <div class="wtotem-ss-disc__wrapper">
935 <div id="disk-chart"></div>
936 <div class="wtotem-ss-disc__totals">
937 <p class="wtotem-ss-disc__totals-caption"><?= __( 'Total', 'wtotem' ) ?></p>
938 <p class="wtotem-ss-disc__totals-value"><?= $arguments["serverStatus"]["discUsage"]['total']?></p>
939 </div>
940 </div>
941 <ul class="wtotem-ss-disc__legend">
942 <li class="wtotem-ss-disc__legend-item wtotem-ss-disc__legend-item--use">
943 <p class="wtotem-ss-disc__legend-value"><?= $arguments["serverStatus"]["discUsage"]['use']?></p>
944 <p class="wtotem-ss-disc__legend-caption"><?= __( 'Use', 'wtotem' ) ?></p>
945 </li>
946 <li class="wtotem-ss-disc__legend-item wtotem-ss-disc__legend-item--free">
947 <p class="wtotem-ss-disc__legend-value"><?= $arguments["serverStatus"]["discUsage"]['free']?></p>
948 <p class="wtotem-ss-disc__legend-caption"><?= __( 'Free', 'wtotem' ) ?></p>
949 </li>
950 </ul>
951 <?php endif; ?>
952 </div>
953 </div>
954 </section>
955
956 </div>
957
958 </div>
959
960 <div class="wtotem_table__footer">
961 <a target="_blank" href="https://wtotem.com/faq/#hs-chat-open" class="wtotem_table__link">
962 <div class="wtotem_table__perfomance">
963 <?= __( 'Need more support?', 'wtotem' ) ?>
964 <span><?= __( 'Let\'s talk!', 'wtotem' ) ?></span>
965 </div>
966 </a>
967 </div>
968 </div>
969 </div>
970 </div>
971 </div>
972
973 <script>
974 var availability_percent = "<?=$arguments["wa"]["availability_percent"]?>";
975
976 var wtotem_token = "<?=$arguments["settings"]["token"]?>";
977 var wtotem_site_id = "<?=$arguments["settings"]["site_id"]?>";
978 var wtotem_am_process_status = "<?=$arguments["am"]["process_status"]?>";
979 var wtotem_av_process_status = "<?=$arguments["vc"]["_status"]?>";
980 var wtotem_waf_process_status = "<?=$arguments["waf"]["_status"]?>";
981 var wtotem_dashbord = true;
982
983 var wtotem_socket_url = "wss://api.wtotem.com/graphql";
984
985 document.addEventListener('DOMContentLoaded', function () {
986 if (wtotem_am_process_status === "installing") {
987 let firewall_selector = document.getElementsByClassName("wtotem_unit__block_firewall");
988 let firewall_installed_selector = document.getElementById("wtsec_firewall_block_installed");
989 let firewall_installing_selector = document.getElementById("wtsec_firewall_block_installing");
990 let firewall_failed_selector = document.getElementById("wtsec_firewall_block_failed");
991 let antivirus_selector = document.getElementsByClassName("wtotem_unit__block_antivirus");
992 let antivirus_installed_selector = document.getElementById("wtsec_antivirus_block_installed");
993 let antivirus_installing_selector = document.getElementById("wtsec_antivirus_block_installing");
994 let antivirus_failed_selector = document.getElementById("wtsec_antivirus_block_failed");
995 let firewall = false, antivirus = false;
996
997 function show_hide(selector,show = true){
998 if(show){
999 selector.style.display = "flex";
1000 }else{
1001 selector.style.display = "none";
1002 }
1003 }
1004
1005 function show_hide_in_loop(selectors,show = true){
1006 for(let selector of selectors){
1007 show_hide(selector,show);
1008 }
1009 }
1010
1011 switch (wtotem_waf_process_status){
1012 case 'installing' || 'not_installed':
1013 show_hide(firewall_installing_selector,true);
1014 break;
1015 case 'internal_error' || 'update_error' || 'config_error':
1016 show_hide(firewall_failed_selector,true);
1017 break;
1018 case 'installed':
1019 show_hide(firewall_installed_selector,true);
1020 break;
1021 default:
1022 show_hide(firewall_installing_selector,true);
1023 }
1024
1025 switch (wtotem_av_process_status){
1026 case 'installing' || 'not_installed':
1027 show_hide(antivirus_installing_selector,true);
1028 break;
1029 case 'internal_error' || 'update_error' || 'config_error':
1030 show_hide(antivirus_failed_selector,true);
1031 break;
1032 case 'installed':
1033 show_hide(antivirus_installed_selector,true);
1034 break;
1035 default:
1036 show_hide(antivirus_installing_selector,true);
1037 }
1038
1039
1040 let variables = {
1041 input: {
1042 token: wtotem_token,
1043 service: 'am',
1044 siteId: wtotem_site_id,
1045 },
1046 }
1047 let query = `subscription EventsSubscription($input: EventsInput!) {
1048 events(input: $input) {
1049 siteId hostname status service
1050 error {
1051 message
1052 __typename
1053 }
1054 __typename
1055 }
1056 }`;
1057 const sub = graphQLSubscriber(wtotem_socket_url, {},
1058 (error, subscribe) => {
1059 if (!(error || subscribe)) {
1060
1061 // Normal closure.
1062 return
1063 }
1064 if (error) {
1065 wtsec_showNotification(__('Connection is broken, please reload the page','wtotem'),'error');
1066 console.error(error);
1067 AmplitudeAnalytics.agentInstallConfirm(firewall,antivirus);
1068 throw error
1069 }
1070 const unsubscribe = subscribe(
1071 query,
1072 variables,
1073 null,
1074 (error, data) => {
1075 console.log(data);
1076 if (!(error || subscribe)) {
1077 //AmplitudeAnalytics.agentInstallConfirm(firewall,antivirus);
1078 // Normal closure
1079 return
1080 }
1081 if (error) {
1082 wtsec_showNotification(__('Connection is broken, please reload the page','wtotem'),'error');
1083 console.error(error);
1084 AmplitudeAnalytics.agentInstallConfirm(firewall,antivirus);
1085 throw error
1086 }
1087
1088 if (data.events.status === "waf_installed") {
1089 show_hide_in_loop(firewall_selector, false);
1090 show_hide(firewall_installed_selector,true);
1091 firewall = true;
1092 } else if (data.events.status === "av_installed") {
1093 show_hide_in_loop(antivirus_selector, false);
1094 show_hide(antivirus_installed_selector,true);
1095 antivirus = true;
1096 } else if (data.events.status === "am_installed") {
1097
1098 } else {
1099 let split = data.events.status.split("_");
1100 if(split.length === 0){
1101 return;
1102 }
1103 let service = split[0];
1104 if (service === "waf") {
1105 show_hide_in_loop(firewall_selector, false);
1106 show_hide(firewall_failed_selector,true);
1107 }
1108 if (service === "av") {
1109 show_hide_in_loop(antivirus_selector, false);
1110 show_hide(antivirus_failed_selector,true);
1111 }
1112 if (service === "am") {
1113
1114 }
1115
1116 AmplitudeAnalytics.agentInstallConfirm(firewall,antivirus);
1117 }
1118
1119 if(firewall && antivirus){
1120 AmplitudeAnalytics.agentInstallConfirm(firewall,antivirus);
1121 }
1122 })
1123
1124 })
1125
1126 }
1127 });
1128 </script>
1129
1130 <?php if($arguments['api_key_activated']):?>
1131 <script>
1132 window.addEventListener('DOMContentLoaded', function () {
1133 AmplitudeAnalytics.apiKeyActivated();
1134 });
1135 </script>
1136 <?php endif; ?>
1137
1138 <script>
1139 window.addEventListener('DOMContentLoaded', function () {
1140 AmplitudeAnalytics.setUser('<?= $arguments['settings']['email'] ?>');
1141 });
1142
1143 var waf_chart = <?php echo $arguments["waf"]["chart"] ?: 'false' ?>;
1144 var serverStatusRam = <?php echo $arguments["serverStatus"]["ramChart"] ?: 'false' ?>;
1145 var serverStatusCpu = <?php echo $arguments["serverStatus"]["cpuChart"] ?: 'false' ?>;
1146 var serverStatusDiscUsage = <?= json_encode($arguments["serverStatus"]["discUsage"])?>;
1147
1148 if(typeof waf_chart == "object" && typeof drawWafChart != 'undefined'){
1149 drawWafChart(waf_chart);
1150 }
1151 if(typeof serverStatusRam == "object" && typeof drawRamChart != 'undefined'){
1152 drawRamChart(serverStatusRam);
1153 }
1154 if(typeof serverStatusCpu == "object" && typeof drawCpuChart != 'undefined') {
1155 drawCpuChart(serverStatusCpu);
1156 }
1157 if(typeof serverStatusDiscUsage == "object" && typeof drawDiskChart != 'undefined') {
1158 drawDiskChart(serverStatusDiscUsage);
1159 }
1160 </script>
1161 <?php else: ?>
1162 <!-- No data block -->
1163 <section class="wtotem_reports-no-data" style="height:300px" >
1164 <h2 class="visually-hidden"><?= __( 'No data', 'wtotem' ) ?></h2>
1165 <p class="wtotem_reports-no-data__text">
1166 <?= __( 'Has no action ready yet', 'wtotem' ) ?>
1167 </p>
1168 </section>
1169 <?php endif; ?>