build-logs: extract compute_runtime_secs helper; clamp runtime in js

This commit is contained in:
damocles 2026-06-01 17:38:21 +02:00 committed by mara
commit aa96d76e73
2 changed files with 7 additions and 3 deletions

View file

@ -1127,7 +1127,7 @@ window.marked = marked;
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))
? el('span', { class: 'build-logs-runtime meta' }, fmtDuration(Math.max(0, h.runtime_secs)))
: h.started_at && !h.finished_at
? el('span', {
class: 'build-logs-runtime meta',