From 6e633c936740e0ae8db3233e1940ddb8a26f37db Mon Sep 17 00:00:00 2001 From: Mikkeli Matlock Date: Mon, 16 Feb 2026 21:08:40 +0900 Subject: [PATCH] pi status server update --- stats_server.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/stats_server.py b/stats_server.py index b15363b..9a93757 100644 --- a/stats_server.py +++ b/stats_server.py @@ -60,7 +60,17 @@ def _get_net_throughput() -> tuple[float, float]: return rx_kbps, tx_kbps - +# only services that matter +SERVICES_ALIASES = { + "gitea": "gitea", + "samba": "samba", + "pihole": "pihole", + "qbittorrent": "qbittorrent", + "frpc-primary": "frpc (ny)", + "pinepods": "pinepods", + "frpc-ssh": "frpc (ssh)", + "jellyfin": "jellyfin", +} def _get_docker_services() -> list[dict]: """Query Docker for real container statuses with ternary status model.""" try: @@ -81,15 +91,15 @@ def _get_docker_services() -> list[dict]: continue name, raw_status = parts - if raw_status.startswith("Up"): - if "unhealthy" in raw_status or "Restarting" in raw_status: - status = "warning" - else: - status = "running" - else: + if (name in SERVICES_ALIASES): + if raw_status.startswith("Up"): + if "unhealthy" in raw_status or "Restarting" in raw_status: + status = "warning" + else: + status = "running" + else: status = "stopped" - - services.append({"name": name, "status": status}) + services.append({"name": SERVICES_ALIASES[name], "status": status}) # Sort: warnings first, then stopped, then running (problems float to top) order = {"warning": 0, "stopped": 1, "running": 2}