fix: cpu/mem container view

This commit is contained in:
2026-03-27 18:23:16 +01:00
parent 7d2f19f81f
commit 94a2f4586a
3 changed files with 175 additions and 69 deletions
+2 -3
View File
@@ -29,7 +29,7 @@ _PODMAN_API_BASE = None
_STATS_CACHE_BY_NAME = {} # name -> {"cpu": float|None, "mem_usage": float|None, "mem_perc": float|None}
_STATS_CACHE_TS = None
_STATS_POLLER_TASK = None
_STATS_SHOWN_NAMES: set = set() # namen van systemd-managed containers uit laatste dashboard call
_STATS_SHOWN_NAMES: set = set() # namen van alle dashboard-containers uit laatste dashboard call
# --- EXEC SESSION CACHE (in-memory) ---
_EXEC_SESSIONS = {} # session_id -> _ExecSessionState
@@ -461,12 +461,11 @@ def init_containers_router(
row["Status"] = (out or "").strip()
dashboard.append(row)
# Bijwerken welke namen systemd-managed zijn (voor /stats filter)
# Bijwerken welke containernamen in het dashboard staan (voor /stats filter)
global _STATS_SHOWN_NAMES
_STATS_SHOWN_NAMES = {
_norm_container_name((c.get("Names") or ["?"])[0])
for c in dashboard
if c.get("_dashboard_source") == "systemd"
} - {"?", ""}
return dashboard