refacto: dashboard Flask Blueprints + templates Jinja2, engine run/lore_enricher mis a jour

This commit is contained in:
2026-06-17 14:10:01 +00:00
parent ae6356ded4
commit ea8e24e238
24 changed files with 2457 additions and 1850 deletions
+26
View File
@@ -0,0 +1,26 @@
import os
import json
SIM_CONFIGS_DIR = os.getenv("SIM_CONFIGS_DIR", "/app/src/config")
_REFERENCE_CONFIG_ID = 1
def load_sim_config(session_id: int) -> dict | None:
path = os.path.join(SIM_CONFIGS_DIR, f"sim_{session_id:03d}.json")
try:
with open(path) as f:
return json.load(f)
except Exception:
return None
def save_sim_config(session_id: int, cfg: dict):
path = os.path.join(SIM_CONFIGS_DIR, f"sim_{session_id:03d}.json")
with open(path, "w") as f:
json.dump(cfg, f, indent=2, ensure_ascii=False)
def load_all_modes() -> dict:
cfg = load_sim_config(_REFERENCE_CONFIG_ID) or {}
return cfg.get("modes", {})