diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-12 18:32:30 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-12 18:32:30 +0100 |
| commit | b9410a1c40f6d4e871f68c5f397000d64769a41b (patch) | |
| tree | a744328947d9db3cdd92d77fa95bbe87044b5f2c /static/modules | |
| parent | 28a5a51c0a5e059a0389ddd1e75c6ecc91f6e38d (diff) | |
| download | deck-it-b9410a1c40f6d4e871f68c5f397000d64769a41b.tar.gz deck-it-b9410a1c40f6d4e871f68c5f397000d64769a41b.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'static/modules')
| -rw-r--r-- | static/modules/sbbuilder.js | 24 |
1 files changed, 20 insertions, 4 deletions
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) { <span class="meta"><span></span></span> <div class="bar busy"><i></i></div>`; } + // 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)}%` : ""; } |
