build-logs: surface runtime_secs in header; show duration in dashboard row
This commit is contained in:
parent
e99330ef0f
commit
26c9c13cf5
2 changed files with 30 additions and 4 deletions
|
|
@ -1126,10 +1126,19 @@ window.marked = marked;
|
|||
: 'running';
|
||||
const age = h.started_at
|
||||
? fmtAgeSecs(nowUnix - h.started_at) + ' ago' : '?';
|
||||
const runtimeSpan = h.runtime_secs != null
|
||||
? el('span', { class: 'build-logs-runtime meta' }, fmtDuration(h.runtime_secs))
|
||||
: h.started_at && !h.finished_at
|
||||
? el('span', {
|
||||
class: 'build-logs-runtime meta',
|
||||
'data-bl-elapsed': String(h.started_at),
|
||||
}, fmtElapsed(Math.max(0, nowUnix - h.started_at)))
|
||||
: null;
|
||||
const rowBtn = el('button',
|
||||
{ type: 'button', class: 'build-logs-row-btn', 'aria-expanded': 'false' },
|
||||
el('span', { class: `badge ${statusCls}` }, statusLabel),
|
||||
el('span', { class: 'build-logs-kind' }, h.kind),
|
||||
runtimeSpan,
|
||||
el('span', { class: 'build-logs-age meta' }, age),
|
||||
el('span', { class: 'build-logs-cmdline meta' }, h.cmdline),
|
||||
);
|
||||
|
|
@ -2192,6 +2201,12 @@ window.marked = marked;
|
|||
const elapsed = Math.max(0, Math.floor(Date.now() / 1000 - started));
|
||||
span.textContent = '· ' + fmtElapsed(elapsed);
|
||||
}
|
||||
for (const span of document.querySelectorAll('.build-logs-runtime[data-bl-elapsed]')) {
|
||||
const started = parseInt(span.dataset.blElapsed, 10);
|
||||
if (!started) continue;
|
||||
const elapsed = Math.max(0, Math.floor(Date.now() / 1000 - started));
|
||||
span.textContent = fmtElapsed(elapsed);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
// ─── reminders ──────────────────────────────────────────────────────────
|
||||
|
|
|
|||
Loading…
Reference in a new issue