dashboard(core): add disk column to the LOAD container-resources table

Surfaces the per-container on-disk footprint the c0re sampler now
reports as `disk_bytes` on /api/container-resources (state dir +
container writable rootfs, shared nix store excluded; sampled
out-of-band every few minutes). Renders bytes→human via the existing
cloadFmtBytes helper, with an em-dash until the first sample lands
(disk_bytes is null then). Pairs with the hive-c0re sampler half.
This commit is contained in:
iris 2026-06-17 18:48:20 +02:00 committed by mara
commit fe5e0bd841

View file

@ -387,7 +387,7 @@ function renderContainerLoad(rows) {
const table = document.createElement('table');
table.className = 'hive-stats-table';
table.innerHTML = '<thead><tr><th>agent</th><th>cpu</th><th>memory</th>'
+ '<th>peak</th><th>limit</th></tr></thead>';
+ '<th>peak</th><th>limit</th><th>disk</th></tr></thead>';
const tb = document.createElement('tbody');
for (const r of rows) {
const tr = document.createElement('tr');
@ -409,6 +409,13 @@ function renderContainerLoad(rows) {
const lim = document.createElement('td'); lim.className = 'num';
lim.textContent = r.mem_max_bytes ? cloadFmtBytes(Number(r.mem_max_bytes)) : '∞';
tr.append(lim);
// Disk: on-disk footprint (state dir + container writable rootfs, shared
// nix store excluded). Sampled out-of-band every few minutes server-side,
// so it's null until the first sample lands — show an em-dash then.
const disk = document.createElement('td'); disk.className = 'num';
disk.title = 'state dir + container writable rootfs (shared nix store excluded); sampled every few minutes';
disk.textContent = (r.disk_bytes != null) ? cloadFmtBytes(Number(r.disk_bytes)) : '—';
tr.append(disk);
tb.append(tr);
}
table.append(tb);