@enigmax/dashboard 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/assets/index.html +15 -2
  2. package/package.json +1 -1
package/assets/index.html CHANGED
@@ -306,6 +306,9 @@
306
306
  <div>Projected <b id="uBlockProj">-</b></div>
307
307
  </div>
308
308
  </div>
309
+ <div id="uProviders" class="sub" style="margin:4px 0 0"></div>
310
+ <h2 style="margin:18px 0 10px">By Account <small>per Claude login</small></h2>
311
+ <div id="uByAccount"></div>
309
312
  <h2 style="margin:18px 0 10px">By Model</h2>
310
313
  <div id="uByModel"></div>
311
314
  <h2 style="margin:18px 0 10px">By Project</h2>
@@ -599,12 +602,20 @@
599
602
  function renderRecentSessions(el, rows, pending) {
600
603
  rows = rows || [];
601
604
  if (!rows.length) { el.innerHTML = '<div class="empty" style="padding:16px 0">' + (pending ? "Scanning..." : "No sessions yet.") + "</div>"; return; }
602
- el.innerHTML = '<table class="tbl"><thead><tr><th>Last active</th><th>Project</th><th>Model</th><th class="r">Input</th><th class="r">Output</th><th class="r">Cost</th></tr></thead><tbody>'
603
- + rows.map((s) => '<tr><td>' + (s.lastActive ? new Date(s.lastActive).toLocaleString() : "-") + '</td><td>' + esc(shortProject(s.project)) + '</td><td>' + esc(s.model || "-")
605
+ el.innerHTML = '<table class="tbl"><thead><tr><th>Last active</th><th>Account</th><th>Project</th><th>Model</th><th class="r">Input</th><th class="r">Output</th><th class="r">Cost</th></tr></thead><tbody>'
606
+ + rows.map((s) => '<tr><td>' + (s.lastActive ? new Date(s.lastActive).toLocaleString() : "-") + '</td><td>' + esc(s.account || "default") + '</td><td>' + esc(shortProject(s.project)) + '</td><td>' + esc(s.model || "-")
604
607
  + '</td><td class="r">' + fmt(s.input) + '</td><td class="r">' + fmt(s.output) + '</td><td class="r">' + fmtUsd(s.cost || 0) + "</td></tr>").join("")
605
608
  + "</tbody></table>";
606
609
  }
607
610
 
611
+ function renderProviders(list) {
612
+ list = list || [];
613
+ const el = $("uProviders");
614
+ if (!list.length) { el.innerHTML = ""; return; }
615
+ el.innerHTML = "Providers: " + list.map((p) =>
616
+ '<span class="tag ' + (p.available ? "meas" : "") + '">' + esc(p.label) + (p.available ? "" : " - " + esc(p.note)) + "</span>").join("");
617
+ }
618
+
608
619
  function renderUsage(u) {
609
620
  const panel = $("usagePanel"), hint = $("usageHint");
610
621
  if (!u) { panel.style.display = "none"; hint.style.display = "block"; return; }
@@ -633,6 +644,8 @@
633
644
  $("uBlockBurn").textContent = fmt(Math.round(b.burnRatePerMin || 0)) + " tok/min";
634
645
  $("uBlockProj").textContent = fmt(b.projectedTokens || 0) + " · " + fmtUsd(b.projectedCost || 0);
635
646
  } else { bw.style.display = "none"; }
647
+ renderProviders(u.providers);
648
+ renderUsageTable($("uByAccount"), u.byAccount, u.pending, "Account");
636
649
  renderUsageTable($("uByModel"), u.byModel, u.pending, "Model");
637
650
  renderUsageTable($("uByProject"), u.byProject, u.pending, "Project");
638
651
  renderRecentSessions($("uRecent"), u.recentSessions, u.pending);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enigmax/dashboard",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Local browser dashboard UI for enigma: the static page and chart assets enigma serves on its loopback dashboard (savings, real tool usage, in-browser settings). Installed on demand by enigma-cli; not a runtime dependency.",
5
5
  "type": "module",
6
6
  "files": [