@enigmax/dashboard 0.1.67 → 0.1.69
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 +12 -8
- package/package.json +1 -1
package/assets/index.html
CHANGED
|
@@ -3501,9 +3501,13 @@ export {
|
|
|
3501
3501
|
catch { $("accountsBody").innerHTML = '<div class="empty" style="padding:24px 0">Accounts unavailable.</div>'; }
|
|
3502
3502
|
}
|
|
3503
3503
|
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>';
|
|
3504
|
+
const REFRESH_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="M23 4v6h-6"/><path d="M1 20v-6h6"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></svg>';
|
|
3504
3505
|
function accountRow(a) {
|
|
3506
|
+
const stateTxt = a.loginState === "expired" ? "session expired" : a.loginState === "empty" ? "signed out" : a.loginState === "absent" ? "not logged in" : "";
|
|
3505
3507
|
const badges = (a.active ? '<span class="tag meas">active</span>' : "")
|
|
3506
|
-
+ (a.loggedIn
|
|
3508
|
+
+ (a.loggedIn
|
|
3509
|
+
? '<span class="tag">' + esc(a.email || "logged in") + "</span>"
|
|
3510
|
+
: '<span class="tag warn">' + (a.email ? esc(a.email) + " · " : "") + (stateTxt || "not logged in") + "</span>");
|
|
3507
3511
|
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>";
|
|
3508
3512
|
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>";
|
|
3509
3513
|
// Provider override (e.g. MiniMax) only for tools that support it, and never the
|
|
@@ -3511,7 +3515,7 @@ export {
|
|
|
3511
3515
|
const provBtn = (a.supportsProvider && a.removable) ? btn("provider", "Provider") : "";
|
|
3512
3516
|
const acts = '<div class="set-ctl" style="display:flex;gap:6px;flex-wrap:wrap;align-items:center">'
|
|
3513
3517
|
+ (a.active ? "" : btn("activate", "Use"))
|
|
3514
|
-
+ (a.loggedIn ? "" :
|
|
3518
|
+
+ btn("login", a.loggedIn ? "Re-login" : "Log in")
|
|
3515
3519
|
+ provBtn
|
|
3516
3520
|
+ (a.removable ? btn("rename", "Rename") + removeBtn : "")
|
|
3517
3521
|
+ "</div>";
|
|
@@ -3559,7 +3563,7 @@ export {
|
|
|
3559
3563
|
const r = await fetch("/api/accounts", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(Object.assign({ op }, payload)) });
|
|
3560
3564
|
const out = await r.json();
|
|
3561
3565
|
if (out.data) renderAccounts(out.data);
|
|
3562
|
-
if (out.ok) { setNote("accountsNote", "Saved.", "ok"); return; }
|
|
3566
|
+
if (out.ok) { setNote("accountsNote", out.note || "Saved.", "ok"); return; }
|
|
3563
3567
|
if (rollback && !out.data) rollback();
|
|
3564
3568
|
setNote("accountsNote", "Error: " + (out.error || "failed"), "err");
|
|
3565
3569
|
} catch { if (rollback) rollback(); setNote("accountsNote", "Could not reach the server.", "err"); }
|
|
@@ -3643,7 +3647,7 @@ export {
|
|
|
3643
3647
|
if (op === "activate") accAction("account.activate", { tool, name });
|
|
3644
3648
|
else if (op === "remove") { if (await askConfirm("Remove account", "Remove account '" + name + "' and delete its local config dir?", true)) accAction("account.remove", { tool, name }); }
|
|
3645
3649
|
else if (op === "rename") { const taken = accAccounts.filter((a) => a.tool === tool).map((a) => a.name); const nn = await askText("Rename account", name, "Rename '" + name + "' to:", nameValidator(taken, name)); if (nn && nn !== name) accAction("account.rename", { tool, name, newName: nn }); }
|
|
3646
|
-
else if (op === "login")
|
|
3650
|
+
else if (op === "login") accAction("account.login", { tool, name });
|
|
3647
3651
|
else if (op === "provider") {
|
|
3648
3652
|
const a = accAccounts.find((x) => x.tool === tool && x.name === name);
|
|
3649
3653
|
if (!a) return;
|
|
@@ -3801,15 +3805,15 @@ export {
|
|
|
3801
3805
|
const actions = p.installed
|
|
3802
3806
|
? '<button type="button" class="toggle on" data-pack="launch" data-id="' + esc(p.id) + '">Launch command</button>'
|
|
3803
3807
|
+ '<button type="button" class="toggle" data-pack="setup" data-id="' + esc(p.id) + '" title="Register the pack MCP servers (needs Python 3)">Setup MCP</button>'
|
|
3804
|
-
+ '<button type="button" class="
|
|
3805
|
-
+ '<button type="button" class="btn-danger" data-pack="remove" data-id="' + esc(p.id) + '">
|
|
3808
|
+
+ '<button type="button" class="iconbtn" data-pack="update" data-id="' + esc(p.id) + '" title="Update" aria-label="Update ' + esc(p.label) + '">' + REFRESH_ICON + "</button>"
|
|
3809
|
+
+ '<button type="button" class="btn-danger icon" data-pack="remove" data-id="' + esc(p.id) + '" title="Remove" aria-label="Remove ' + esc(p.label) + '">' + TRASH_ICON + "</button>"
|
|
3806
3810
|
: '<button type="button" class="toggle on" data-pack="install" data-id="' + esc(p.id) + '">Install</button>';
|
|
3807
3811
|
const stTag = (s) => s === "expired" ? " (login expired)" : s === "empty" ? " (not signed in)" : s === "absent" ? " (no login)" : "";
|
|
3808
3812
|
const opts = '<option value="">follow active (' + esc(p.resolvedAccount || "default") + ")" + stTag(p.resolvedState) + "</option>"
|
|
3809
3813
|
+ (p.accounts || []).map((a) => '<option value="' + esc(a.name) + '"' + (p.defaultAccount === a.name ? " selected" : "") + ">" + esc(a.name) + (a.label && a.label !== a.name ? " - " + esc(a.label) : "") + stTag(a.state) + "</option>").join("");
|
|
3810
|
-
const warn = p.installed && (p.resolvedState === "expired" || p.resolvedState === "empty")
|
|
3814
|
+
const warn = (p.installed && !p.contextReady && (p.resolvedState === "expired" || p.resolvedState === "empty"))
|
|
3811
3815
|
? '<div class="set-hint" style="margin-top:6px;color:var(--warn,#e0a020)">This login is ' + (p.resolvedState === "expired" ? "expired" : "not signed in") + ' - the pack may ask you to log in. Refresh it (launch that account once) or pick another above.</div>'
|
|
3812
|
-
: "";
|
|
3816
|
+
: (p.installed && p.contextReady ? '<div class="set-hint" style="margin-top:6px;color:var(--ok)">Active session ready - launches without asking to log in.</div>' : "");
|
|
3813
3817
|
const accountSel = p.installed
|
|
3814
3818
|
? '<label class="set-hint" style="display:flex;align-items:center;gap:8px;margin-top:10px">Account that seeds this pack:'
|
|
3815
3819
|
+ '<select data-pack-account data-id="' + esc(p.id) + '">' + opts + "</select></label>" + warn
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enigmax/dashboard",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.69",
|
|
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": [
|