diff --git a/webui/html/index.html b/webui/html/index.html
index cf40bd3..bda5b5a 100644
--- a/webui/html/index.html
+++ b/webui/html/index.html
@@ -707,6 +707,7 @@
const table = tbody.closest('table');
const colCount = table ? table.querySelectorAll('thead th').length : 9;
+ containersC2P = new Map();
let html = '';
@@ -768,8 +769,9 @@
- |
- |
${isRealPod ? 'pod' : '-'} |
- - |
- - |
+
+ - |
+ - |
${esc(podPortsText)} |
${isRealPod ? `
@@ -787,6 +789,8 @@
`;
for (const c of items) {
+ const cname = normalizeContainerName((c.Names && c.Names[0]) ? c.Names[0] : (c.Names || c.Name || c.name || ''));
+ if (cname) containersC2P.set(cname, pod);
const row = renderContainerRow(c).replace(
' | {
const payload = JSON.parse(ev.data);
const statsList = payload?.data?.Stats || [];
+ // totals per pod voor deze SSE tick
+ const podCpu = new Map(); // podName -> cpuPct sum
+ const podMem = new Map(); // podName -> memBytes sum
+ const podMemPct = new Map(); // podName -> memPct sum
for (const st of statsList) {
const cname = normalizeContainerName(st?.Name);
@@ -854,6 +863,30 @@
const key = cssSafeId(cname);
+ const pod = containersC2P.get(cname);
+ if (pod) {
+ const cpuPct = Number(st?.CPUPerc ?? st?.CPU ?? st?.AvgCPU ?? 0);
+ const memBytes = Number(st?.MemUsage ?? 0);
+ const memPct = Number(st?.MemPerc ?? 0);
+
+ podCpu.set(pod, (podCpu.get(pod) || 0) + cpuPct);
+ podMem.set(pod, (podMem.get(pod) || 0) + memBytes);
+ podMemPct.set(pod, (podMemPct.get(pod) || 0) + memPct);
+ }
+
+ for (const [pod, cpuSum] of podCpu.entries()) {
+ const el = document.getElementById(`podcpu-${cssSafeId(pod)}`);
+ if (el) el.textContent = cpuSum.toFixed(2) + "%";
+ }
+
+ for (const [pod, memSum] of podMem.entries()) {
+ const el = document.getElementById(`podmem-${cssSafeId(pod)}`);
+ if (el) {
+ const memPct = podMemPct.get(pod) || 0;
+ el.textContent = `${formatBytes(memSum)} (${memPct.toFixed(1)}%)`;
+ }
+ }
+
// CPU: jouw API geeft CPU als fractie (0.00384 -> 0.384%)
const cpuPct = Number(st?.CPUPerc ?? st?.CPU ?? st?.AvgCPU ?? 0);
const cpuEl = document.getElementById(`cpu-${key}`);