@enigmax/dashboard 0.1.8 → 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 +18 -4
  2. package/package.json +1 -1
package/assets/index.html CHANGED
@@ -286,7 +286,7 @@
286
286
  </div>
287
287
  <div class="panel" id="usagePanel" style="display:none">
288
288
  <h2 style="margin:0 0 4px">Usage limits <small>same windows Claude Code shows</small></h2>
289
- <div class="sub" style="margin-bottom:12px">Reset times and tokens are measured from your transcripts; the <b>% used</b> needs your plan limit (set it on a card, or with <code>enigma config plan-weekly-limit &lt;tokens&gt;</code>). The weekly reset day/time is <code>enigma config plan-weekly-reset "mon 11:00"</code>.</div>
289
+ <div class="sub" style="margin-bottom:12px">Cards marked <span class="tag meas">live</span> show the <b>real % and reset</b> Anthropic reports (the same as Claude's own UI), captured by the local proxy from your <code>enigma claude</code> traffic - no plan limit needed. Until the proxy has seen a request, the card falls back to tokens used, or a % against a plan limit you set (on the card, or <code>enigma config plan-weekly-limit &lt;tokens&gt;</code>). Per-model live data appears only when Anthropic sends it.</div>
290
290
  <div id="uWindows"></div>
291
291
  <div class="grid" style="margin-bottom:16px">
292
292
  <div class="card"><div class="label">Est. Cost</div><div id="uCost" class="value accent">-</div><div class="foot">All sessions, per-model pricing</div></div>
@@ -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>
@@ -555,7 +558,8 @@
555
558
  + '<div class="wset"><input type="number" min="0" class="wlimit" data-plan="' + sub + '" placeholder="set limit (tokens)">'
556
559
  + '<button type="button" class="laddb" data-plan="' + sub + '">Set</button></div>';
557
560
  }
558
- return '<div class="wcard"><div class="wtitle">' + esc(w.label) + '</div><div class="wreset">' + esc(reset) + '</div>' + body + '</div>';
561
+ const live = w.live ? ' <span class="tag meas">live</span>' : "";
562
+ return '<div class="wcard"><div class="wtitle">' + esc(w.label) + live + '</div><div class="wreset">' + esc(reset) + '</div>' + body + '</div>';
559
563
  }
560
564
  function renderWindows(u) {
561
565
  const w = u && u.windows;
@@ -598,12 +602,20 @@
598
602
  function renderRecentSessions(el, rows, pending) {
599
603
  rows = rows || [];
600
604
  if (!rows.length) { el.innerHTML = '<div class="empty" style="padding:16px 0">' + (pending ? "Scanning..." : "No sessions yet.") + "</div>"; return; }
601
- 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>'
602
- + 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 || "-")
603
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("")
604
608
  + "</tbody></table>";
605
609
  }
606
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
+
607
619
  function renderUsage(u) {
608
620
  const panel = $("usagePanel"), hint = $("usageHint");
609
621
  if (!u) { panel.style.display = "none"; hint.style.display = "block"; return; }
@@ -632,6 +644,8 @@
632
644
  $("uBlockBurn").textContent = fmt(Math.round(b.burnRatePerMin || 0)) + " tok/min";
633
645
  $("uBlockProj").textContent = fmt(b.projectedTokens || 0) + " · " + fmtUsd(b.projectedCost || 0);
634
646
  } else { bw.style.display = "none"; }
647
+ renderProviders(u.providers);
648
+ renderUsageTable($("uByAccount"), u.byAccount, u.pending, "Account");
635
649
  renderUsageTable($("uByModel"), u.byModel, u.pending, "Model");
636
650
  renderUsageTable($("uByProject"), u.byProject, u.pending, "Project");
637
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.8",
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": [