pi status server update
This commit is contained in:
@@ -60,7 +60,17 @@ def _get_net_throughput() -> tuple[float, float]:
|
|||||||
|
|
||||||
return rx_kbps, tx_kbps
|
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]:
|
def _get_docker_services() -> list[dict]:
|
||||||
"""Query Docker for real container statuses with ternary status model."""
|
"""Query Docker for real container statuses with ternary status model."""
|
||||||
try:
|
try:
|
||||||
@@ -81,15 +91,15 @@ def _get_docker_services() -> list[dict]:
|
|||||||
continue
|
continue
|
||||||
name, raw_status = parts
|
name, raw_status = parts
|
||||||
|
|
||||||
if raw_status.startswith("Up"):
|
if (name in SERVICES_ALIASES):
|
||||||
if "unhealthy" in raw_status or "Restarting" in raw_status:
|
if raw_status.startswith("Up"):
|
||||||
status = "warning"
|
if "unhealthy" in raw_status or "Restarting" in raw_status:
|
||||||
else:
|
status = "warning"
|
||||||
status = "running"
|
else:
|
||||||
else:
|
status = "running"
|
||||||
|
else:
|
||||||
status = "stopped"
|
status = "stopped"
|
||||||
|
services.append({"name": SERVICES_ALIASES[name], "status": status})
|
||||||
services.append({"name": name, "status": status})
|
|
||||||
|
|
||||||
# Sort: warnings first, then stopped, then running (problems float to top)
|
# Sort: warnings first, then stopped, then running (problems float to top)
|
||||||
order = {"warning": 0, "stopped": 1, "running": 2}
|
order = {"warning": 0, "stopped": 1, "running": 2}
|
||||||
|
|||||||
Reference in New Issue
Block a user