@lifeaitools/clauth 1.30.22 → 1.30.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.
@@ -1537,7 +1537,7 @@ function renderSupervisorSurface(surface) {
1537
1537
  return '<div class="supervisor-row"><div class="supervisor-row-top"><span class="supervisor-name">' + htmlEscape(surface.plugin_id + ":" + surface.id) + '</span>' + supervisorBadge(surface.lifecycle_owner || "unknown", ownerKind) + supervisorBadge(surface.state || surface.status || "unknown", stateKind) + '</div>' +
1538
1538
  '<div class="supervisor-meta">' + htmlEscape(surface.destination || "—") + ' · port ' + htmlEscape(surface.port || "—") + '</div>' +
1539
1539
  '<div class="supervisor-meta">' + htmlEscape(surface.health || surface.health_url || "no health") + '</div>' +
1540
- '<div class="supervisor-row-actions">' + ["start","stop","restart","reconcile","test","promote","rollback"].map(a => '<button class="supervisor-action" data-supervisor-action="' + a + '" onclick="runSupervisorSurface(' + jsArg(surface.plugin_id + ":" + surface.id) + ',' + jsArg(a) + ',this)">' + a + '</button>').join("") + '</div></div>';
1540
+ '<div class="supervisor-row-actions">' + '<button class="supervisor-action" data-supervisor-action="enable" onclick="toggleSurfaceEnabled(' + jsArg(surface.plugin_id) + ',' + (surface.enabled === false ? 'true' : 'false') + ',this)">' + (surface.enabled === false ? "enable" : "disable") + '</button>' + ["start","stop","restart","reconcile","test","promote","rollback"].map(a => '<button class="supervisor-action" data-supervisor-action="' + a + '" onclick="runSupervisorSurface(' + jsArg(surface.plugin_id + ":" + surface.id) + ',' + jsArg(a) + ',this)">' + a + '</button>').join("") + '</div></div>';
1541
1541
  }
1542
1542
 
1543
1543
  async function rescanSupervisorPlugins() {
@@ -1557,7 +1557,7 @@ async function runSupervisorSurface(id, action, btn) {
1557
1557
  const result = receipt.resulting_state || {};
1558
1558
  const ok = result.ok !== false;
1559
1559
  if (btn) { btn.textContent = ok ? "done" : "failed"; btn.style.background = ok ? "#14532d" : "#7f1d1d"; }
1560
- supervisorFeedback(id + " " + action + " " + (ok ? "succeeded" : "failed") + " " + " -> " + " " + (result.state || result.reason || "completed"), !ok);
1560
+ supervisorFeedback(id + " " + action + " " + (ok ? "succeeded" : "failed") + " -> " + (result.state || result.reason || "completed"), !ok);
1561
1561
  await new Promise((resolve) => setTimeout(resolve, 700));
1562
1562
  await loadSupervisorCockpit();
1563
1563
  } catch (err) {
@@ -1567,6 +1567,20 @@ async function runSupervisorSurface(id, action, btn) {
1567
1567
  }
1568
1568
  }
1569
1569
 
1570
+ async function toggleSurfaceEnabled(pluginId, enable, btn) {
1571
+ const originalLabel = btn ? btn.textContent : null;
1572
+ if (btn) { btn.disabled = true; btn.textContent = "..."; btn.style.opacity = "0.6"; }
1573
+ try {
1574
+ const receipt = await supervisorJson("/v1/plugins/" + encodeURIComponent(pluginId) + "/" + (enable ? "enable" : "disable"), { method: "POST", headers: writeHeaders() });
1575
+ supervisorFeedback(pluginId + " " + (enable ? "enabled" : "disabled"), receipt.error ? true : false);
1576
+ await new Promise((resolve) => setTimeout(resolve, 500));
1577
+ await loadSupervisorCockpit();
1578
+ } catch (err) {
1579
+ supervisorFeedback(pluginId + " " + (enable ? "enable" : "disable") + " failed: " + (err.message || err), true);
1580
+ if (btn) { setTimeout(() => { btn.disabled = false; btn.textContent = originalLabel; btn.style.opacity = ""; }, 2000); }
1581
+ }
1582
+ }
1583
+
1570
1584
  // ── Unlock ──────────────────────────────────
1571
1585
  async function unlock() {
1572
1586
  const input = document.getElementById("lock-input");
@@ -1655,9 +1669,6 @@ async function lockVault() {
1655
1669
  // suppresses repeated dialogs for a tab ("prevent this page from creating
1656
1670
  // additional dialogs") -- both cases fail with zero visible feedback.
1657
1671
  function unlockWrites() {
1658
- if (writeToken) {
1659
- if (!confirm("Writes are already unlocked this session. Re-unlock?")) return;
1660
- }
1661
1672
  openWriteUnlockModal();
1662
1673
  }
1663
1674
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifeaitools/clauth",
3
- "version": "1.30.22",
3
+ "version": "1.30.23",
4
4
  "description": "Hardware-bound credential vault for the LIFEAI infrastructure stack",
5
5
  "type": "module",
6
6
  "bin": {
Binary file
Binary file
Binary file