@enigmax/dashboard 0.1.18 → 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 +13 -6
  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 || {};
@@ -1500,14 +1509,12 @@
1500
1509
  }
1501
1510
 
1502
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"];
1503
1514
  function route() {
1504
1515
  const h = (location.hash || "").replace(/^#\/?/, "");
1505
- const v = ["usage", "accounts", "settings", "skills"].includes(h) ? h : "savings";
1506
- $("view-savings").style.display = v === "savings" ? "" : "none";
1507
- $("view-usage").style.display = v === "usage" ? "" : "none";
1508
- $("view-accounts").style.display = v === "accounts" ? "" : "none";
1509
- $("view-skills").style.display = v === "skills" ? "" : "none";
1510
- $("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"; });
1511
1518
  document.querySelectorAll(".tab").forEach((t) => t.classList.toggle("active", t.dataset.view === v));
1512
1519
  if (v === "settings" && !settingsLoaded) { settingsLoaded = true; loadSettings(); }
1513
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.18",
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": [