diff --git a/backend/main.py b/backend/main.py index 2817350..5e053cf 100644 --- a/backend/main.py +++ b/backend/main.py @@ -444,6 +444,15 @@ async def api_eteindre(): return {"succes": True} +@app.post("/api/systeme/quitter-navigateur") +async def api_quitter_navigateur(): + import subprocess + log.warning("Fermeture navigateur demandee") + subprocess.Popen(["pkill", "-f", "firefox"]) + subprocess.Popen(["pkill", "-f", "chromium"]) + return {"succes": True} + + # --- WebSocket --- @app.websocket("/ws") diff --git a/frontend/index.html b/frontend/index.html index 5050f0e..ae1e8a9 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -486,6 +486,7 @@

Systeme

+ diff --git a/frontend/js/admin.js b/frontend/js/admin.js index e371104..b285860 100644 --- a/frontend/js/admin.js +++ b/frontend/js/admin.js @@ -631,6 +631,10 @@ function confirmerExtinction() { if (confirm('Eteindre le systeme ?')) apiPost('/api/systeme/eteindre'); } +function quitterNavigateur() { + apiPost('/api/systeme/quitter-navigateur'); +} + // === Utilitaires === function setValue(id, val) {