fix(qualys/dashboard): compteur base sur running_since DB (survit aux auto-refresh)

This commit is contained in:
Pierre & Lumière 2026-04-25 00:16:44 +00:00
parent 0ab4f2d8fa
commit 66558c4b46

View File

@ -22,12 +22,20 @@
<script> <script>
setTimeout(function() { window.location.href = '/qualys/dashboard'; }, 15000); setTimeout(function() { window.location.href = '/qualys/dashboard'; }, 15000);
(function() { (function() {
{% if running_since %}
var t0 = new Date("{{ running_since.isoformat() }}").getTime();
{% else %}
var t0 = Date.now(); var t0 = Date.now();
{% endif %}
var el = document.getElementById('elapsed'); var el = document.getElementById('elapsed');
setInterval(function() { function tick() {
var s = Math.floor((Date.now() - t0) / 1000); var s = Math.floor((Date.now() - t0) / 1000);
if (el) el.textContent = '+' + s + 's'; var m = Math.floor(s / 60);
}, 1000); var sec = s % 60;
if (el) el.textContent = '+' + (m > 0 ? m + 'm ' : '') + sec + 's';
}
tick();
setInterval(tick, 1000);
})(); })();
</script> </script>
{% elif msg == 'already_running' %} {% elif msg == 'already_running' %}