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 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'static/dashboard.js') 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) => { -- cgit v1.2.3