@enigmax/dashboard 0.1.65 → 0.1.66

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
@@ -3804,10 +3804,17 @@ export {
3804
3804
  + '<button type="button" class="toggle" data-pack="update" data-id="' + esc(p.id) + '">Update</button>'
3805
3805
  + '<button type="button" class="btn-danger" data-pack="remove" data-id="' + esc(p.id) + '">Remove</button>'
3806
3806
  : '<button type="button" class="toggle on" data-pack="install" data-id="' + esc(p.id) + '">Install</button>';
3807
+ const opts = '<option value="">follow active (' + esc(p.resolvedAccount || "default") + ')</option>'
3808
+ + (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) : "") + "</option>").join("");
3809
+ const accountSel = p.installed
3810
+ ? '<label class="set-hint" style="display:flex;align-items:center;gap:8px;margin-top:10px">Account that seeds this pack:'
3811
+ + '<select data-pack-account data-id="' + esc(p.id) + '">' + opts + "</select></label>"
3812
+ : "";
3807
3813
  return '<div class="panel"><div class="set-row"><div class="set-meta">'
3808
3814
  + '<div class="set-name">' + esc(p.label) + " " + state + " " + added + '</div>'
3809
3815
  + '<div class="set-hint">' + esc(p.description) + '</div>'
3810
3816
  + '<div class="set-hint" style="margin-top:6px">' + tags + ' &nbsp; <a href="' + esc(p.homepage) + '" target="_blank" rel="noopener">source</a></div>'
3817
+ + accountSel
3811
3818
  + '</div></div><div class="set-ctl" style="display:flex;gap:8px;flex-wrap:wrap;margin-top:8px">' + actions + '</div></div>';
3812
3819
  }).join("");
3813
3820
  }
@@ -3816,12 +3823,12 @@ export {
3816
3823
  try { renderPacks((await (await fetch("/api/packs", { cache: "no-store" })).json()).packs); }
3817
3824
  catch { $("packsBody").innerHTML = '<div class="empty" style="padding:12px 0">Packs unavailable.</div>'; }
3818
3825
  }
3819
- async function packAction(id, action) {
3826
+ async function packAction(id, action, value) {
3820
3827
  const confirmMsg = action === "remove" ? "Remove this pack and its isolated context?" : null;
3821
3828
  if (confirmMsg && !(await askConfirm("Confirm", confirmMsg, true))) return;
3822
3829
  setNote("packsNote", action === "install" || action === "update" ? "Working..." : "Saving...");
3823
3830
  try {
3824
- const out = await (await fetch("/api/packs", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ id, action }) })).json();
3831
+ const out = await (await fetch("/api/packs", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ id, action, value }) })).json();
3825
3832
  if (out.packs) renderPacks(out.packs);
3826
3833
  if (out.command) { try { await navigator.clipboard.writeText(out.command); } catch { /* clipboard blocked */ } }
3827
3834
  setNote("packsNote", out.note || out.error || (out.ok ? "Done." : "Action failed."), out.ok ? "ok" : "err");
@@ -3834,6 +3841,12 @@ export {
3834
3841
  if (!b) return;
3835
3842
  packAction(b.dataset.id, b.dataset.pack);
3836
3843
  });
3844
+ // Pin which account seeds a pack (empty value = follow the active account).
3845
+ $("view-packs").addEventListener("change", (e) => {
3846
+ const sel = e.target.closest("select[data-pack-account]");
3847
+ if (!sel) return;
3848
+ packAction(sel.dataset.id, "set-account", sel.value);
3849
+ });
3837
3850
  }
3838
3851
 
3839
3852
  // --- recall subpage (local session memory; reads your own transcripts) ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enigmax/dashboard",
3
- "version": "0.1.65",
3
+ "version": "0.1.66",
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": [