From b9410a1c40f6d4e871f68c5f397000d64769a41b Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Thu, 12 Nov 2026 18:32:30 +0100 Subject: feat(dashboard): show build progress in the build VM slot The build VM slot showed a busy bar and the job kind. It now reads `sbb-remote jobs --active` (sb-builder 0.13.0), whose running build carries progress: the package being built on the first line, done of total (dependencies included, from the preview's plan) on the right, the op, the package's ETA, the estimated end and failures on the second line, and a bar that fills as packages finish. Other jobs keep the busy bar. Polling only active jobs also stops pulling the whole job history over ssh every 10s. Co-Authored-By: Claude Opus 5.5 --- static/deck.css | 1 + static/modules/sbbuilder.js | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) (limited to 'static') diff --git a/static/deck.css b/static/deck.css index 471aa07..328d201 100644 --- a/static/deck.css +++ b/static/deck.css @@ -749,6 +749,7 @@ select { .dash .slot .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--udt-border-1), var(--udt-border-2), var(--udt-border-3)); } .dash .slot .bar.busy i { width: 30%; animation: slot-busy 1.6s ease-in-out infinite alternate; } +.dash .slot .bar:not(.busy) i { transition: width 0.6s ease; } @keyframes slot-busy { from { margin-left: 0; } to { margin-left: 70%; } } .dash .slot .sthumb { display: none; } @container slot (min-width: 700px) { diff --git a/static/modules/sbbuilder.js b/static/modules/sbbuilder.js index 357133f..e183132 100644 --- a/static/modules/sbbuilder.js +++ b/static/modules/sbbuilder.js @@ -31,10 +31,26 @@ export function slot(st, el) {
`; } + // A running build carries sbb-remote's progress: the package on line 1, done + // of total (dependencies included) on the right, op, its ETA, the estimated + // end and failures on line 2, and a real bar. Every slot width works the + // same: the lines slide when they do not fit. const jobs = active(st); + const p = jobs[0]?.progress; const load = st.stats?.load; - el.querySelector(".what > span").textContent = `Build VM · ${jobs[0]?.kind || "job"}`; - el.querySelector(".pct").textContent = jobs.length > 1 ? `${jobs.length} jobs` : ""; - el.querySelector(".meta > span").textContent = - [jobs[0]?.status, load ? `load ${load[0].toFixed(2)}` : null].filter(Boolean).join(" · "); + const hm = (t) => new Date(t * 1000).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }); + el.querySelector(".what > span").textContent = + p?.current?.split("/").pop() || `Build VM · ${jobs[0]?.kind || "job"}`; + el.querySelector(".pct").textContent = + p?.total ? `${p.done}/${p.total}` : jobs.length > 1 ? `${jobs.length} jobs` : ""; + el.querySelector(".meta > span").textContent = [ + p ? p.op : jobs[0]?.status, + p?.eta && `ETA ${p.eta}`, + p?.end && `ends ~${hm(p.end)}`, + p?.failed && `${p.failed} failed`, + load && `load ${load[0].toFixed(2)}`, + ].filter(Boolean).join(" · "); + const bar = el.querySelector(".bar"); + bar.classList.toggle("busy", !p?.total); + bar.firstChild.style.width = p?.total ? `${Math.min(100, (100 * p.done) / p.total)}%` : ""; } -- cgit v1.2.3