Feat: update agent version to 1.2.0 and add systemd services listing in VpsCard component
All checks were successful
Build and Push Docker Images / docker (push) Successful in 25s

This commit is contained in:
jeanotx32
2026-06-02 19:59:57 -04:00
parent 57132f92ee
commit b2b660e035
5 changed files with 94 additions and 5 deletions

View File

@@ -47,7 +47,7 @@ from webauthn.helpers.structs import (
# ─── Config ───────────────────────────────────────────────────────────────────
DB_FILE = Path(os.getenv("DB_FILE", "data/monitor.db"))
EXPECTED_AGENT_VERSION = os.getenv("EXPECTED_AGENT_VERSION", "1.1.0")
EXPECTED_AGENT_VERSION = os.getenv("EXPECTED_AGENT_VERSION", "1.2.0")
# ─── Ring buffer de stats (en mémoire) ───────────────────────────────────────
_STATS_MAX_POINTS = 120 # 10 min à 5 s d'intervalle
@@ -498,6 +498,12 @@ async def fetch_vps_status(vps: dict) -> dict:
try:
containers_res = await agent_get(vps, "/containers")
# Services systemd (non-Docker) — optionnel, agent >= 1.2.0
try:
services_res = await agent_get(vps, "/services")
except Exception:
services_res = []
# Source unique : ring buffer → carte et modal affichent exactement la même valeur
history = _stats_history.get(vps["id"])
if history:
@@ -531,6 +537,7 @@ async def fetch_vps_status(vps: dict) -> dict:
"description": vps.get("description", ""),
"online": True,
"containers": containers_res,
"services": services_res,
"system": system,
"tags": vps.get("tags", []),
"agent_version": agent_version,
@@ -546,6 +553,7 @@ async def fetch_vps_status(vps: dict) -> dict:
"online": False,
"error": str(e),
"containers": [],
"services": [],
"system": None,
"tags": vps.get("tags", []),
"agent_version": None,