Qualys agents page: bandeau sync en cours + boutons sync desactives + bouton Annuler
This commit is contained in:
parent
1dc7560f44
commit
48249d1c82
@ -517,11 +517,15 @@ def qualys_agents_page(request: Request, db=Depends(get_db)):
|
||||
inactive = [{"hostname": r.hostname, "os": r.os, "agent_version": r.agent_version,
|
||||
"last_checkin": r.last_checkin, "etat": r.etat or ""} for r in inactive_rows]
|
||||
|
||||
from ..services.qualys_service import is_refresh_running
|
||||
sync_running = is_refresh_running()
|
||||
|
||||
ctx = base_context(request, db, user)
|
||||
ctx.update({
|
||||
"app_name": APP_NAME, "keys": keys, "summary": summary,
|
||||
"no_agent_servers": no_agent, "inactive_agents": inactive,
|
||||
"msg": request.query_params.get("msg", ""),
|
||||
"sync_running": sync_running,
|
||||
})
|
||||
return templates.TemplateResponse("qualys_agents.html", ctx)
|
||||
|
||||
|
||||
@ -7,10 +7,10 @@
|
||||
<p class="text-xs text-gray-500 mt-1">Activation keys et versions des agents déployés</p>
|
||||
</div>
|
||||
<div style="display:flex;gap:8px">
|
||||
<button id="btn-refresh-diff" class="btn-primary px-4 py-2 text-sm" onclick="refreshAgents('diff')" title="Pull seulement les assets modifies depuis le dernier sync">
|
||||
<button id="btn-refresh-diff" class="btn-primary px-4 py-2 text-sm" onclick="refreshAgents('diff')" title="Pull seulement les assets modifies depuis le dernier sync" {% if sync_running %}disabled{% endif %}>
|
||||
Sync rapide (diff)
|
||||
</button>
|
||||
<button id="btn-refresh-full" class="btn-sm bg-cyber-yellow text-black px-4 py-2 text-sm" onclick="refreshAgents('full')" title="Pull complet (5-10 min). A faire 1x par jour">
|
||||
<button id="btn-refresh-full" class="btn-sm bg-cyber-yellow text-black px-4 py-2 text-sm" onclick="refreshAgents('full')" title="Pull complet (5-10 min). A faire 1x par jour" {% if sync_running %}disabled{% endif %}>
|
||||
Sync complete
|
||||
</button>
|
||||
<a href="/qualys/deploy" class="btn-sm bg-cyber-border text-gray-300 px-4 py-2">Déployer</a>
|
||||
@ -18,6 +18,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if sync_running %}
|
||||
<div class="card p-3 mb-4" style="border:1px solid #f59e0b;background:rgba(245,158,11,0.1)">
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<span class="text-cyber-yellow font-bold">⏳ Synchronisation Qualys en cours</span>
|
||||
<span class="text-xs text-gray-400 ml-2">Les boutons de sync sont désactivés. Les données ci-dessous peuvent être en cours de mise à jour.</span>
|
||||
</div>
|
||||
<form method="POST" action="/qualys/agents/cancel" style="display:inline">
|
||||
<button class="btn-sm bg-cyber-red text-white px-3 py-1">Annuler</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Overlay chargement -->
|
||||
<div id="refresh-overlay" style="display:none;position:fixed;inset:0;background:rgba(0,0,0,0.7);z-index:9999;justify-content:center;align-items:center">
|
||||
<div class="card p-6 text-center" style="min-width:320px">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user