diff --git a/services/web-ui/public/screens-playout.jsx b/services/web-ui/public/screens-playout.jsx index 49f9d23..965d32c 100644 --- a/services/web-ui/public/screens-playout.jsx +++ b/services/web-ui/public/screens-playout.jsx @@ -24,6 +24,26 @@ async function poFetch(path, opts) { return window.ZAMPP_API.fetch('/playout' + path, opts); } +// ── Helpers ────────────────────────────────────────────────────────────────── + +function fmtDuration(secs) { + if (!secs || secs < 0) return '—'; + const s = Math.floor(secs); + const h = Math.floor(s / 3600); + const m = Math.floor((s % 3600) / 60); + const ss = s % 60; + const mm = String(m).padStart(2, '0'); + const ssStr = String(ss).padStart(2, '0'); + return h > 0 ? `${h}:${mm}:${ssStr}` : `${m}:${ssStr}`; +} + +function itemEffectiveDuration(it) { + const total = (it.asset_duration_ms || 0) / 1000; + const inPt = it.in_point != null ? Number(it.in_point) : 0; + const outPt = it.out_point != null ? Number(it.out_point) : total; + return Math.max(0, outPt - inPt); +} + // ── Output-config sub-form (varies by output type) ─────────────────────────── function OutputConfigFields({ type, config, onChange }) { const set = (k, v) => onChange({ ...config, [k]: v }); @@ -175,29 +195,37 @@ function MediaBin({ projectId }) { ); } -const MEDIA_STATUS_BADGE = { - ready: 'success', staging: 'warn', pending: 'neutral', error: 'error', -}; +// ── Staging progress bar ────────────────────────────────────────────────────── +function StagingBar({ status }) { + return ( +