From 978ec811803cdbeb10dc2e6924ab33aa2b84bec6 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 11 Nov 2026 09:53:37 +0100 Subject: feat(dashboard): pending updates in the system row, icons, opencode logo The system row now ends with "N updates available", keystone's "to install" count from updatesctl ([dashboard] updates; empty hides it). stats re-reads it in a thread every 5 minutes, so the NFS reads behind it never stall the 1 s poll. The codename reads "-current" next to the OS name, so it no longer looks like part of the kernel. Kernel and uptime get tux and clock icons, the row is tighter, and its separators are a "|" in the first Hyprland border colour instead of an unreadable dot. The opencode spending card shows the opencode logo by its title. Co-Authored-By: Claude Opus 5.5 --- static/dashboard.js | 25 ++++++++++++++++--------- static/deck.css | 9 +++++---- 2 files changed, 21 insertions(+), 13 deletions(-) (limited to 'static') diff --git a/static/dashboard.js b/static/dashboard.js index 390c802..21e1cf3 100644 --- a/static/dashboard.js +++ b/static/dashboard.js @@ -24,7 +24,7 @@ export const HISTORY = 120; // trend samples: two minutes at 1 s const RUNNING = ["k1c", "sbbuilder", "obs"]; // the running row's order const G = { cpu: "", mem: "\u{f035b}", gpu: "\u{f08ae}", net: "\u{f04e1}", - wifi: "", charging: "\u{f0084}", tux: "" }; + wifi: "", charging: "\u{f0084}", tux: "", clock: "" }; const BATTERY = ["", "", "", "", ""]; // Nerd Font distro logos by os-release ID. const DISTRO = { @@ -109,8 +109,10 @@ const SKELETON = `
-
- ·
+
+ |${G.tux} + |${G.clock} + |
${G.cpu}
@@ -164,8 +166,12 @@ export default { if (on.has("stats")) poll("stats", 1, (st) => { $(".logo").textContent = DISTRO[st.os?.id] ?? G.tux; $(".os").textContent = st.os?.name ?? ""; - $(".kernel").textContent = [st.os?.codename, `Linux ${st.os?.kernel ?? ""}`].filter(Boolean).join(" · "); - $(".up").textContent = `up ${uptime(st.uptime)}`; + $(".codename").textContent = st.os?.codename ? `-${st.os.codename}` : ""; + $(".codename").hidden = !st.os?.codename; + $(".kernel").textContent = st.os?.kernel ?? ""; + $(".up").textContent = uptime(st.uptime); + for (const e of root.querySelectorAll(".upd")) e.hidden = st.updates == null; + $(".n-upd").textContent = `${st.updates} update${st.updates === 1 ? "" : "s"} available`; push(hist.cpu, st.cpu); push(hist.down, st.net.down); push(hist.up, st.net.up); $(".c-cpu .n").textContent = st.cpuName ?? ""; $(".c-cpu path").setAttribute("d", area(hist.cpu, Math.max(25, ...hist.cpu))); @@ -187,17 +193,18 @@ export default { chip(".c-net", `↓${rate(st.net.down)} ↑${rate(st.net.up)}`); }); - const program = (title, p) => { + const program = (title, p, brand) => { + const h3 = `

${brand ? `` : ""}${esc(title)}

`; const model = `${esc(p.model ? short(p.model) : "—")}`; if (!(p.cost > 0)) { // local or free models: tokens, not dollars - return `

${esc(title)}

${model} + return `
${h3}${model} session${tok(p.session_tokens)} total${tok(p.tokens)}
`; } const parts = spendParts(p.models); const total = parts.reduce((a, m) => a + m.cost, 0); const color = (m, i) => (m.model === "other" ? OTHER : SPEND[i]); - return `

${esc(title)}

${model}
+ return `
${h3}${model}
session
${money(p.session_cost)}
${tok(p.session_tokens)} · ${p.session_calls ?? 0} calls
@@ -223,7 +230,7 @@ export default { chip(".c-5h", pct(c.five_hour_pct), null, c.five_hour_pct, c.five_hour_pct >= 80); chip(".c-7d", pct(c.seven_day_pct), null, c.seven_day_pct, c.seven_day_pct >= 80); spend._offline = null; - spend.innerHTML = program("opencode", st.opencode ?? {}) + program("Local Agent", st.assistant ?? {}); + spend.innerHTML = program("opencode", st.opencode ?? {}, "opencode") + program("Local Agent", st.assistant ?? {}); }); if (on.has("tablet")) poll("tablet", 10, (t) => { diff --git a/static/deck.css b/static/deck.css index 1d02a85..35c6335 100644 --- a/static/deck.css +++ b/static/deck.css @@ -646,10 +646,11 @@ select { .dash-defs { position: absolute; } .dash-top { display: grid; grid-template-rows: auto 1fr 1fr; gap: 8px; min-height: 0; } -.dash-id { display: flex; align-items: center; gap: 14px; font-size: 0.857rem; color: var(--udt-subtext0); white-space: nowrap; overflow: hidden; } -.dash-id .logo { font-size: 1.15rem; color: var(--udt-accent); } +.dash-id { display: flex; align-items: center; gap: 8px; font-size: 0.857rem; color: var(--udt-subtext0); white-space: nowrap; overflow: hidden; } +.dash-id .logo { font-size: 1.15rem; color: var(--udt-accent); margin-right: 4px; } +.dash-id .nf:not(.logo) { margin-right: 10px; } /* the glyphs draw past their advance */ .dash-id b { color: var(--udt-text); font-weight: 600; } -.dash-id .sep { color: var(--udt-surface2); } +.dash-id .sep { color: var(--udt-border-1); font-weight: 600; } .dash .chips { display: grid; gap: 8px; min-height: 0; } .dash .chips.sys { grid-template-columns: 1fr 1fr 1fr 1.3fr; } .dash .chips.aux { grid-template-columns: 1fr 1fr 1fr 1fr 1.3fr; } @@ -687,7 +688,7 @@ select { .dash .prog { display: flex; flex-direction: column; gap: 6px; } .dash .prog header { display: flex; align-items: baseline; gap: 10px; } -.dash .prog h3 { margin: 0; font-size: 0.857rem; text-transform: uppercase; letter-spacing: .08em; color: var(--udt-subtext0); } +.dash .prog h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.857rem; text-transform: uppercase; letter-spacing: .08em; color: var(--udt-subtext0); } .dash .prog .model { margin-left: auto; font-size: 0.786rem; color: var(--udt-overlay0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .dash .prog .nums { display: flex; gap: 22px; align-items: baseline; } .dash .prog .big { font-size: 1.25rem; font-weight: 600; } -- cgit v1.2.3