feat(containers): reset pod CPU/MEM totals bij stoppen of fout van stats-stream

This commit is contained in:
kodi
2026-02-19 16:41:44 +01:00
parent c81f603ccc
commit 427d7b47a1
+11 -1
View File
@@ -903,7 +903,7 @@
}); });
containersStatsES.onerror = () => { containersStatsES.onerror = () => {
// EventSource reconnect automatisch; geen actie nodig resetPodTotals();
}; };
} }
@@ -911,8 +911,18 @@
if (!containersStatsES) return; if (!containersStatsES) return;
containersStatsES.close(); containersStatsES.close();
containersStatsES = null; containersStatsES = null;
resetPodTotals();
} }
function resetPodTotals() {
document.querySelectorAll('[id^="podcpu-"]').forEach(el => {
el.textContent = '-';
});
document.querySelectorAll('[id^="podmem-"]').forEach(el => {
el.textContent = '-';
});
}
async function containerInspect(name) { async function containerInspect(name) {
try { try {
const res = await api(`/containers/inspect/${encodeURIComponent(name)}`, 'GET'); const res = await api(`/containers/inspect/${encodeURIComponent(name)}`, 'GET');