diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-10 19:53:32 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-10 19:53:32 +0100 |
| commit | c75b6f1ff69d944bb07b9395880a63620a0a8a00 (patch) | |
| tree | 85275188ebfbaf7863f0089b4644e089cd977604 /static/modules/obs.js | |
| parent | d0c5ae2bf4a8a0ab1ddec409e007e7aef0dfc3e3 (diff) | |
| download | deck-it-c75b6f1ff69d944bb07b9395880a63620a0a8a00.tar.gz deck-it-c75b6f1ff69d944bb07b9395880a63620a0a8a00.zip | |
feat(dashboard): one fixed screen for the tablet
The Dashboard tab drops the draggable card grid for a fixed layout: a
top band of system, Claude and tablet chips with trend and fill
backgrounds, music and spending always on, a row of one to three busy
modules (printer, build VM, OBS) that scroll long lines, and the
action icons in Hyprland's rotating border. The stats, tablet and llm
panels and the vendored Gridstack go.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'static/modules/obs.js')
| -rw-r--r-- | static/modules/obs.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/static/modules/obs.js b/static/modules/obs.js index 6842522..bcf237b 100644 --- a/static/modules/obs.js +++ b/static/modules/obs.js @@ -54,6 +54,26 @@ async function post(action, body = {}) { } } +// The dashboard's running slot: what is live, the scene and the elapsed +// time, and a stop for it. +export const busy = (st) => Boolean(st.connected && (st.recording || st.streaming)); + +export function slot(st, el) { + if (!el.firstChild) { + el.innerHTML = `<i class="nf sic rec"></i> + <span class="what"><span></span></span><span class="pct num"></span> + <span class="meta"><span></span></span> + <button class="act">Stop</button>`; + } + const what = st.recording ? (st.paused ? "Recording paused" : "Recording") : "Streaming"; + el.querySelector(".what > span").textContent = `${what} · ${st.currentScene ?? ""}`; + el.querySelector(".pct").textContent = st.recording ? clock(st.recordingTime) : "live"; + el.querySelector(".meta > span").textContent = + [st.recording ? "recording" : null, st.streaming ? "streaming" : null].filter(Boolean).join(" + "); + el.querySelector(".act").onclick = () => + post(st.recording ? "record" : "stream", { on: false }); +} + function bigButton(kind, name, label, on, times) { const b = document.createElement("button"); b.className = `deck-btn ${kind}${on ? " on" : ""}`; |
