Bulletproof: messages novices, kiosk port auto, reset compteur, sync booth event_id

- Messages erreur camera/impression: texte novice ("Oups!", "Reessayez") au lieu de jargon technique
- kiosk-session.sh: lit le port depuis config.json (plus de http://localhost en dur), healthcheck /api/config, supprime git pull auto au boot
- Activer evenement: reset automatique du compteur photos
- Activer evenement: sync booth.event_id quand galerie live active
- Port par defaut backend: 80 → 8080

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-13 09:17:26 +02:00
parent 96464ccca1
commit f1299fd6a7
5 changed files with 41 additions and 23 deletions

View File

@@ -125,6 +125,10 @@ def activer_evenement(event_id: str) -> dict | None:
event = obtenir_evenement(event_id)
if not event:
return None
config = charger_config()
booth = config.get("booth", {})
if booth.get("actif"):
booth["event_id"] = event_id
mettre_a_jour_config({
"evenement": {
"event_id": event_id,
@@ -134,7 +138,8 @@ def activer_evenement(event_id: str) -> dict | None:
"couleur_secondaire": event.get("couleur_secondaire", "#ffffff"),
"media_accueil": event.get("media_accueil"),
"formats_actifs": event.get("formats_actifs", ["10x15", "15x20", "strip"]),
}
},
"booth": booth,
})
log.info(f"Evenement active : {event['nom']} ({event_id})")
return event

View File

@@ -1736,6 +1736,8 @@ async def api_activer_evenement(event_id: str):
event = activer_evenement(event_id)
if not event:
return JSONResponse({"erreur": "Evenement introuvable"}, status_code=404)
reset_compteur()
log.info(f"Compteur photos remis a zero (activation evenement {event_id})")
await diffuser_ws({"type": "config_maj", "config": charger_config()})
return event
@@ -2587,6 +2589,6 @@ if __name__ == "__main__":
uvicorn.run(
app,
host=conf_srv.get("host", "0.0.0.0"),
port=conf_srv.get("port", 80),
port=conf_srv.get("port", 8080),
log_level="info",
)