add Telemetry node Uptime
This commit is contained in:
@@ -426,7 +426,8 @@ def on_message(client, userdata, msg):
|
|||||||
"files": data.get("files", data.get("config_files", [])),
|
"files": data.get("files", data.get("config_files", [])),
|
||||||
"file_names": data.get("file_names", []),
|
"file_names": data.get("file_names", []),
|
||||||
"profiles": data.get("profiles", {"A": "PROFILE A", "B": "PROFILE B"}),
|
"profiles": data.get("profiles", {"A": "PROFILE A", "B": "PROFILE B"}),
|
||||||
"interval": data.get("update_interval")
|
"interval": data.get("update_interval"),
|
||||||
|
"uptime": data.get("uptime_seconds", 0)
|
||||||
}
|
}
|
||||||
bin_versions = data.get("versions", {})
|
bin_versions = data.get("versions", {})
|
||||||
if bin_versions:
|
if bin_versions:
|
||||||
|
|||||||
@@ -758,6 +758,7 @@
|
|||||||
<span>🌡️ <span id="temp-${c.id}">--</span>°C</span>
|
<span>🌡️ <span id="temp-${c.id}">--</span>°C</span>
|
||||||
<span>🧠 <span id="ram-${c.id}">--</span>%</span>
|
<span>🧠 <span id="ram-${c.id}">--</span>%</span>
|
||||||
<span>💾 <span id="disk-${c.id}">--</span>%</span>
|
<span>💾 <span id="disk-${c.id}">--</span>%</span>
|
||||||
|
<span title="System Uptime">⏱️ <span id="up-${c.id}">--</span></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="seen-bar" id="seen-${c.id}" style="display: none;"></div>
|
<div class="seen-bar" id="seen-${c.id}" style="display: none;"></div>
|
||||||
|
|
||||||
@@ -947,6 +948,11 @@
|
|||||||
let tempVal = healthObj.temp; tempSpan.innerText = tempVal; tempSpan.style.color = tempVal < 55 ? 'var(--success)' : (tempVal < 70 ? '#f59e0b' : 'var(--danger)');
|
let tempVal = healthObj.temp; tempSpan.innerText = tempVal; tempSpan.style.color = tempVal < 55 ? 'var(--success)' : (tempVal < 70 ? '#f59e0b' : 'var(--danger)');
|
||||||
ramSpan.innerText = healthObj.ram; let d = healthObj.disk; diskSpan.innerText = d; diskSpan.style.color = d < 85 ? 'inherit' : (d < 95 ? '#f59e0b' : 'var(--danger)');
|
ramSpan.innerText = healthObj.ram; let d = healthObj.disk; diskSpan.innerText = d; diskSpan.style.color = d < 85 ? 'inherit' : (d < 95 ? '#f59e0b' : 'var(--danger)');
|
||||||
|
|
||||||
|
let upSpan = document.getElementById(`up-${c.id}`);
|
||||||
|
if (upSpan && healthObj.uptime) {
|
||||||
|
upSpan.innerText = fmtAge(healthObj.uptime);
|
||||||
|
}
|
||||||
|
|
||||||
const profBtnsDiv = document.getElementById(`prof-btns-${c.id}`);
|
const profBtnsDiv = document.getElementById(`prof-btns-${c.id}`);
|
||||||
const profKeys = JSON.stringify(healthObj.profiles || {});
|
const profKeys = JSON.stringify(healthObj.profiles || {});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user