diff --git a/app/routers/qualys.py b/app/routers/qualys.py index 7d4bbf7..4edb444 100644 --- a/app/routers/qualys.py +++ b/app/routers/qualys.py @@ -153,12 +153,16 @@ async def qualys_tags(request: Request, db=Depends(get_db), FROM qualys_tags """)).fetchone() + 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, "tags": tags, "stats": stats, "search": search, "tag_type": tag_type, "can_edit_qualys": can_edit(perms, "qualys"), "msg": request.query_params.get("msg"), + "sync_running": sync_running, }) return templates.TemplateResponse("qualys_tags.html", ctx) diff --git a/app/templates/qualys_tags.html b/app/templates/qualys_tags.html index e693c58..63ff244 100644 --- a/app/templates/qualys_tags.html +++ b/app/templates/qualys_tags.html @@ -6,13 +6,20 @@
{% if can_edit_qualys %}
- +
{% endif %} Export CSV
+{% if sync_running %} +
+ ⏳ Synchronisation Qualys en cours + Le bouton Resync API est désactivé. Patiente la fin du sync agents. +
+{% endif %} + {% if msg %}
{% if msg == 'resync_ok' %}Tags resynchronisés depuis l'API Qualys.{% elif msg == 'busy' %}⏳ Une synchronisation Qualys est déjà en cours (agents). Patiente quelques minutes puis réessaie.{% elif msg and msg.startswith('resync_ko') %}Erreur de synchronisation : {{ msg[10:].replace('+', ' ') if msg|length > 10 else 'API Qualys indisponible' }}{% elif msg == 'created' %}Tag créé.{% elif msg == 'create_error' %}Erreur création.{% elif msg == 'deleted' %}Tag supprimé.{% elif msg == 'delete_error' %}Erreur suppression.{% endif %}