| 1 |
{% if process_status %} |
| 2 |
<script type="text/javascript"> |
| 3 |
|
| 4 |
jQuery(document).ready(function ($) { |
| 5 |
|
| 6 |
let ajax_execute = () => { |
| 7 |
jQuery.post(ajaxurl, { |
| 8 |
|
| 9 |
action: 'wtotem_ajax', |
| 10 |
ajax_action: 'agents_installation', |
| 11 |
wtotem_page_nonce: '{{ page_nonce }}', |
| 12 |
|
| 13 |
}, function (data) { |
| 14 |
if(data.agents_statuses){ |
| 15 |
clearInterval(wtotem_check_agents_status); |
| 16 |
} |
| 17 |
jQuery('#wtotem_agents_wrap').html(data.agents); |
| 18 |
jQuery('#wtotem_notifications').html(data.notifications); |
| 19 |
}); |
| 20 |
}; |
| 21 |
|
| 22 |
/* run the check every 10 seconds */ |
| 23 |
let wtotem_check_agents_status = setInterval(() => ajax_execute(), 10000); |
| 24 |
|
| 25 |
/* stop check after 30 min */ |
| 26 |
setTimeout(() => { clearInterval(wtotem_check_agents_status); }, 1800000); |
| 27 |
|
| 28 |
}); |
| 29 |
|
| 30 |
</script> |
| 31 |
|
| 32 |
<div class="wtotem_unit"> |
| 33 |
<div class="wtotem_unit__first section-header-mb"> |
| 34 |
<h2 class="h2 title"> |
| 35 |
{{ 'Agent manager installation' | trans }} |
| 36 |
</h2> |
| 37 |
</div> |
| 38 |
|
| 39 |
<div class="wtotem_unit__wrapper wt_card" id="wtotem_agents_wrap"> |
| 40 |
{% include 'agents_installation.html.twig' with {'process_status': process_status, 'images_path': images_path} %} |
| 41 |
</div> |
| 42 |
</div> |
| 43 |
{% endif %} |
| 44 |
|