From b33d495474386d4b9539763dd7bab1ca3f93a0a0 Mon Sep 17 00:00:00 2001 From: Roby Date: Thu, 22 Oct 2026 21:47:57 +0200 Subject: [PATCH] add agent version --- app.py | 3 ++- templates/index.html | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 70bff8c..f62d5c1 100644 --- a/app.py +++ b/app.py @@ -427,7 +427,8 @@ def on_message(client, userdata, msg): "file_names": data.get("file_names", []), "profiles": data.get("profiles", {"A": "PROFILE A", "B": "PROFILE B"}), "interval": data.get("update_interval"), - "uptime": data.get("uptime_seconds", 0) + "uptime": data.get("uptime_seconds", 0), + "agent_version": data.get("agent_version", "1.0") } bin_versions = data.get("versions", {}) if bin_versions: diff --git a/templates/index.html b/templates/index.html index 67579c5..7fa363f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -743,6 +743,7 @@ ${esc(c.name)}
ID: ${c.id.toUpperCase()} +
@@ -953,7 +954,11 @@ if (upSpan && healthObj.uptime) { upSpan.innerText = fmtAge(healthObj.uptime); } - + let agentBadge = document.getElementById(`agent-badge-${c.id}`); + if (agentBadge && healthObj.agent_version) { + agentBadge.innerText = `Agent v${healthObj.agent_version}`; + agentBadge.style.display = 'inline-block'; + } const profBtnsDiv = document.getElementById(`prof-btns-${c.id}`); const profKeys = JSON.stringify(healthObj.profiles || {}); @@ -976,7 +981,11 @@ } } - } else { if (healthContainer) healthContainer.style.display = 'none'; } + } else { + if (healthContainer) healthContainer.style.display = 'none'; + let agentBadge = document.getElementById(`agent-badge-${c.id}`); + if (agentBadge) agentBadge.style.display = 'none'; + } globalHealthData[c.id.toLowerCase()] = healthObj;