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/k1c.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/k1c.js')
| -rw-r--r-- | static/modules/k1c.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/static/modules/k1c.js b/static/modules/k1c.js index d8211fa..261ef4d 100644 --- a/static/modules/k1c.js +++ b/static/modules/k1c.js @@ -86,6 +86,37 @@ function armHold(btn) { btn.style.setProperty("--hold", `${HOLD_MS}ms`); } +// The dashboard's running slot: file, percent, time left, layer and +// temperatures, the press-and-hold stop and a progress bar. Wide slots show +// the slicer thumbnail in place of the icon (deck.css container query). +export const busy = (st) => !st.offline && (st.state === "printing" || st.state === "paused"); + +export function slot(st, el) { + if (!el.firstChild) { + el.innerHTML = `<i class="nf sic"></i><img class="sthumb" alt="" hidden> + <span class="what"><span></span></span><span class="pct num"></span> + <span class="meta"><span></span></span> + <button class="estop act" aria-label="Emergency stop: press and hold"> + <span class="estop-label">Emergency stop</span><span class="estop-hint">hold</span> + </button> + <div class="bar"><i></i></div>`; + armHold(el.querySelector(".estop")); + } + const p = st.progress ?? 0; + const name = (st.file ?? "").split("/").pop(); + el.querySelector(".what > span").textContent = st.state === "paused" ? `Paused · ${name}` : name; + el.querySelector(".pct").textContent = `${Math.round(p * 100)}%`; + el.querySelector(".meta > span").textContent = [ + `${dur(st.remaining)} left`, + st.layers ? `layer ${st.layer ?? "?"}/${st.layers}` : null, + `${temp(st.extruder)} / ${temp(st.bed)}`, + ].filter(Boolean).join(" · "); + el.querySelector(".bar i").style.width = `${p * 100}%`; + const thumb = el.querySelector(".sthumb"); + thumb.hidden = !st.thumbnail; + if (st.thumbnail && thumb.getAttribute("src") !== st.thumbnail) thumb.src = st.thumbnail; +} + export default { title: "K1C", tab: "K1C", |
