@enigmax/dashboard 0.1.17 → 0.1.19

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 -7
  2. package/package.json +1 -1
package/assets/index.html CHANGED
@@ -923,7 +923,16 @@
923
923
  return moneyOf("unknown", s.tokensSaved || 0);
924
924
  }
925
925
 
926
+ // The server's process-boot id this tab first loaded against. A change means the
927
+ // dashboard server was restarted (e.g. you re-ran `enigma dashboard` after an
928
+ // update), so the served UI may be newer than this tab - reload once so a tab you
929
+ // left open self-heals instead of showing stale markup.
930
+ let loadedBoot = null;
926
931
  function render(data) {
932
+ if (data.boot != null) {
933
+ if (loadedBoot === null) loadedBoot = data.boot;
934
+ else if (data.boot !== loadedBoot) { location.reload(); return; }
935
+ }
927
936
  priceOverride = Number(data.priceOverride) || 0;
928
937
  speedOverride = Number(data.speedOverride) || 0;
929
938
  const s = data.stats || {};
@@ -1292,7 +1301,8 @@
1292
1301
  : s.update === "modified" ? '<span class="tag ext">modified</span>' : "";
1293
1302
  const edit = '<button type="button" class="toggle" data-name="' + esc(s.name) + '" data-action="edit" data-enigma="' + (s.source === "enigma" ? 1 : 0) + '">Edit</button>';
1294
1303
  const main = s.source === "enigma"
1295
- ? '<button type="button" class="toggle' + (s.discarded ? "" : " on") + '" data-name="' + esc(s.name)
1304
+ ? '<button type="button" class="toggle' + (s.discarded ? "" : " on") + '" data-kind="bool" title="'
1305
+ + (s.discarded ? "Disabled - click to enable" : "Enabled - click to disable") + '" data-name="' + esc(s.name)
1296
1306
  + '" data-action="' + (s.discarded ? "enable" : "disable") + '">' + (s.discarded ? "Disabled" : "Enabled") + "</button>"
1297
1307
  : '<button type="button" class="btn-danger" data-name="' + esc(s.name) + '" data-action="remove">Remove</button>';
1298
1308
  return '<div class="set-row"><div class="set-meta"><div class="set-name">' + esc(s.name) + ext + ver + upd + where + "</div>"
@@ -1499,14 +1509,12 @@
1499
1509
  }
1500
1510
 
1501
1511
  // --- hash routing between the subpages ---
1512
+ // Single source of truth for the subpage ids (savings is the default/fallback).
1513
+ const VIEWS = ["savings", "usage", "accounts", "skills", "settings"];
1502
1514
  function route() {
1503
1515
  const h = (location.hash || "").replace(/^#\/?/, "");
1504
- const v = ["usage", "accounts", "settings", "skills"].includes(h) ? h : "savings";
1505
- $("view-savings").style.display = v === "savings" ? "" : "none";
1506
- $("view-usage").style.display = v === "usage" ? "" : "none";
1507
- $("view-accounts").style.display = v === "accounts" ? "" : "none";
1508
- $("view-skills").style.display = v === "skills" ? "" : "none";
1509
- $("view-settings").style.display = v === "settings" ? "" : "none";
1516
+ const v = VIEWS.includes(h) ? h : "savings";
1517
+ VIEWS.forEach((view) => { $("view-" + view).style.display = view === v ? "" : "none"; });
1510
1518
  document.querySelectorAll(".tab").forEach((t) => t.classList.toggle("active", t.dataset.view === v));
1511
1519
  if (v === "settings" && !settingsLoaded) { settingsLoaded = true; loadSettings(); }
1512
1520
  if (v === "skills" && !skillsLoaded) { skillsLoaded = true; loadSkills(); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enigmax/dashboard",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
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": [