feat(qualys/dashboard): bandeau spinner persistant + auto-refresh pendant recalcul

This commit is contained in:
Pierre & Lumière 2026-04-24 23:55:24 +00:00
parent 8f8e8c4d8f
commit 17f508c1d1

View File

@ -3,13 +3,33 @@
{% block content %} {% block content %}
{% set msg = request.query_params.get('msg', '') %} {% set msg = request.query_params.get('msg', '') %}
{% if msg == 'refresh_started' %}
<div class="card p-3 mb-4 bg-blue-900/20 border-blue-500/40 text-blue-300 text-sm"> {% if is_running or msg == 'refresh_started' %}
Recalcul lancé en arrière-plan. Rafraîchis la page dans 1-2 minutes pour voir les nouveaux chiffres. <div id="recalc-banner" class="card p-4 mb-4 bg-cyber-accent/10 border-2 border-cyber-accent flex items-center gap-4">
<div style="border:4px solid rgba(0,212,255,.2); border-top:4px solid #00d4ff; border-radius:50%; width:42px; height:42px; animation:spin 0.9s linear infinite; flex-shrink:0"></div>
<div class="flex-1">
<div class="text-cyber-accent font-bold text-base">Recalcul du dashboard en cours...</div>
<div class="text-xs text-gray-400 mt-1">
Calcul des KPI sur ~1300 assets via API Qualys (durée typique : 3 à 5 minutes).
La page se rafraichira automatiquement.
<span id="elapsed" class="font-mono text-cyber-accent ml-2"></span>
</div>
</div>
</div> </div>
<script>
setTimeout(function() { window.location.href = '/qualys/dashboard'; }, 15000);
(function() {
var t0 = Date.now();
var el = document.getElementById('elapsed');
setInterval(function() {
var s = Math.floor((Date.now() - t0) / 1000);
if (el) el.textContent = '+' + s + 's';
}, 1000);
})();
</script>
{% elif msg == 'already_running' %} {% elif msg == 'already_running' %}
<div class="card p-3 mb-4 bg-yellow-900/20 border-yellow-500/40 text-yellow-300 text-sm"> <div class="card p-3 mb-4 bg-yellow-900/20 border-yellow-500/40 text-yellow-300 text-sm">
Un calcul est déjà en cours. Patiente puis rafraîchis. Un calcul est deja en cours. Patiente puis rafraichis.
</div> </div>
{% endif %} {% endif %}