@enigmax/dashboard 0.1.22 → 0.1.23
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.
- package/assets/index.html +14 -6
- package/package.json +1 -1
package/assets/index.html
CHANGED
|
@@ -212,6 +212,9 @@
|
|
|
212
212
|
border-radius: 7px; padding: 5px 14px; font-size: 12px; cursor: pointer; font-family: inherit;
|
|
213
213
|
}
|
|
214
214
|
.btn-danger:hover { border-color: var(--accent2); }
|
|
215
|
+
.btn-danger.icon { display: inline-flex; align-items: center; justify-content: center; padding: 6px 9px; }
|
|
216
|
+
.btn-danger.icon:hover { color: var(--bad); border-color: var(--bad); }
|
|
217
|
+
.btn-danger svg { width: 15px; height: 15px; display: block; }
|
|
215
218
|
/* List settings (guard block/allow globs, custom secret patterns): chips + add input. A list row spans the full grid width. */
|
|
216
219
|
.set-row.list { grid-column: 1 / -1; align-items: stretch; flex-direction: column; }
|
|
217
220
|
.lchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
|
|
@@ -1652,8 +1655,11 @@ export {
|
|
|
1652
1655
|
} else if (w.resetsAt) {
|
|
1653
1656
|
const start = w.resetsAt - span;
|
|
1654
1657
|
barPct = Math.max(0, Math.min(100, (Date.now() - start) / span * 100));
|
|
1655
|
-
|
|
1656
|
-
|
|
1658
|
+
// No usage % available (no live rate-limit headers, no plan limit): the bar
|
|
1659
|
+
// shows window time-elapsed. Use the brand accent, not dead grey. The green/
|
|
1660
|
+
// yellow/orange/red consumption scale needs a real % (set a limit, or live data).
|
|
1661
|
+
barCol = "var(--accent)";
|
|
1662
|
+
barNote = "window " + Math.round(barPct) + "% elapsed - set a limit for usage %";
|
|
1657
1663
|
valLine = fmt(w.used || 0) + " tok";
|
|
1658
1664
|
} else {
|
|
1659
1665
|
barPct = 0; barCol = "var(--muted)"; barNote = ""; valLine = fmt(w.used || 0) + " tok";
|
|
@@ -2365,14 +2371,16 @@ export {
|
|
|
2365
2371
|
try { const r = await fetch("/api/accounts", { cache: "no-store" }); renderAccounts(await r.json()); }
|
|
2366
2372
|
catch { $("accountsBody").innerHTML = '<div class="empty" style="padding:24px 0">Accounts unavailable.</div>'; }
|
|
2367
2373
|
}
|
|
2374
|
+
const TRASH_ICON = '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18"/><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/><line x1="10" y1="11" x2="10" y2="17"/><line x1="14" y1="11" x2="14" y2="17"/></svg>';
|
|
2368
2375
|
function accountRow(a) {
|
|
2369
2376
|
const badges = (a.active ? '<span class="tag meas">active</span>' : "")
|
|
2370
2377
|
+ (a.loggedIn ? '<span class="tag">' + esc(a.email || "logged in") + "</span>" : '<span class="tag warn">not logged in</span>');
|
|
2371
2378
|
const btn = (act, label, cls) => '<button type="button" class="' + (cls || "toggle") + '" data-acc="' + act + '" data-tool="' + esc(a.tool) + '" data-name="' + esc(a.name) + '">' + label + "</button>";
|
|
2372
|
-
const
|
|
2379
|
+
const removeBtn = '<button type="button" class="btn-danger icon" title="Remove" aria-label="Remove account ' + esc(a.name) + '" data-acc="remove" data-tool="' + esc(a.tool) + '" data-name="' + esc(a.name) + '">' + TRASH_ICON + "</button>";
|
|
2380
|
+
const acts = '<div class="set-ctl" style="display:flex;gap:6px;flex-wrap:wrap;align-items:center">'
|
|
2373
2381
|
+ (a.active ? "" : btn("activate", "Use"))
|
|
2374
2382
|
+ (a.loggedIn ? "" : btn("login", "Log in..."))
|
|
2375
|
-
+ (a.removable ? btn("rename", "Rename") +
|
|
2383
|
+
+ (a.removable ? btn("rename", "Rename") + removeBtn : "")
|
|
2376
2384
|
+ "</div>";
|
|
2377
2385
|
return '<div class="set-row"><div class="set-meta"><div class="set-name">' + esc(a.name) + ' <span class="tag ext">' + esc(a.toolLabel) + "</span> " + badges
|
|
2378
2386
|
+ '</div><div class="set-hint">' + esc(a.dir) + "</div></div>" + acts + "</div>";
|
|
@@ -2385,10 +2393,10 @@ export {
|
|
|
2385
2393
|
return '<label style="font-size:12px;color:var(--muted);display:inline-flex;align-items:center;gap:6px;margin:0 12px 6px 0">' + esc(t.label)
|
|
2386
2394
|
+ ' <select class="choice" data-prof-tool="' + esc(t.name) + '" data-prof="' + esc(p.name) + '">' + opts + "</select></label>";
|
|
2387
2395
|
}).join("");
|
|
2388
|
-
const acts = '<div class="set-ctl" style="display:flex;gap:6px">'
|
|
2396
|
+
const acts = '<div class="set-ctl" style="display:flex;gap:6px;align-items:center">'
|
|
2389
2397
|
+ (p.active ? "" : '<button type="button" class="toggle" data-prof-act="activate" data-name="' + esc(p.name) + '">Use</button>')
|
|
2390
2398
|
+ '<button type="button" class="toggle" data-prof-act="rename" data-name="' + esc(p.name) + '">Rename</button>'
|
|
2391
|
-
+ '<button type="button" class="btn-danger" data-prof-act="remove" data-name="' + esc(p.name) + '">
|
|
2399
|
+
+ '<button type="button" class="btn-danger icon" title="Remove" aria-label="Remove profile ' + esc(p.name) + '" data-prof-act="remove" data-name="' + esc(p.name) + '">' + TRASH_ICON + "</button></div>";
|
|
2392
2400
|
return '<div class="set-row"><div class="set-meta"><div class="set-name">' + esc(p.name) + (p.active ? ' <span class="tag meas">active</span>' : "")
|
|
2393
2401
|
+ '</div><div class="set-hint" style="margin-top:6px">' + maps + "</div></div>" + acts + "</div>";
|
|
2394
2402
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enigmax/dashboard",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
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": [
|