// Dashboard: render KPIs + recent jobs from the real memory read-model. const money = (n) => (n == null ? "—" : `$${Number(n).toFixed(2)}`); const el = (html) => { const t = document.createElement("template"); t.innerHTML = html.trim(); return t.content.firstElementChild; }; async function load() { const data = await (await fetch("/api/dashboard")).json(); document.getElementById("kpis").append( el(`
Jobs forged
${data.job_count}
on this device
Total estimated
${money(data.revenue_total)}
sum of finished estimates
Distinct items used
${data.top_items.length}
across past jobs
| Job note | Items | Total |
|---|
No items learned yet.
`)); } else { top.append( el( `