From c691c4c1913c7724f4fadcdb6b50c87c0cb6093d Mon Sep 17 00:00:00 2001 From: Jules Date: Tue, 7 Apr 2026 18:28:26 +0200 Subject: [PATCH] Bouton quitter le navigateur dans admin > Systeme Co-Authored-By: Claude Opus 4.6 (1M context) --- backend/main.py | 9 +++++++++ frontend/index.html | 1 + frontend/js/admin.js | 4 ++++ 3 files changed, 14 insertions(+) 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) {