@lifeaitools/clauth 2.1.0 → 2.1.1
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/cli/commands/serve.js +41 -10
- package/package.json +1 -1
package/cli/commands/serve.js
CHANGED
|
@@ -907,6 +907,13 @@ export function dashboardHtml(port, whitelist, isStaged = false, initWriteToken
|
|
|
907
907
|
.supervisor-sub{font-size:.76rem;color:#94a3b8;margin-top:3px;line-height:1.35}
|
|
908
908
|
.supervisor-actions{display:flex;gap:8px;flex-wrap:wrap}
|
|
909
909
|
.supervisor-action{background:#0f172a;color:#cbd5e1;border:1px solid #334155;border-radius:6px;padding:6px 10px;font-size:.75rem;cursor:pointer}
|
|
910
|
+
.supervisor-action:hover:not(:disabled){background:#1e293b;border-color:#475569}
|
|
911
|
+
/* Visible but inert until a surface is selected — the operator can always
|
|
912
|
+
SEE which commands exist, which is the whole point of showing them. */
|
|
913
|
+
.supervisor-action:disabled{opacity:.42;cursor:not-allowed}
|
|
914
|
+
/* The selected row has to be unmistakable, otherwise "which surface am I
|
|
915
|
+
about to restart?" is a guess. */
|
|
916
|
+
.supervisor-row.selected{border-color:#38bdf8;background:rgba(56,189,248,.10)}
|
|
910
917
|
.supervisor-action:hover{border-color:#38bdf8;color:#e0f2fe}
|
|
911
918
|
.supervisor-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}
|
|
912
919
|
.supervisor-card{border:1px solid #1e293b;background:rgba(2,6,23,.52);border-radius:10px;padding:10px;min-width:0}
|
|
@@ -1657,7 +1664,11 @@ async function loadSupervisorCockpit() {
|
|
|
1657
1664
|
document.getElementById("supervisor-surface-count").textContent = String(surfaceRows.length - 1);
|
|
1658
1665
|
document.getElementById("supervisor-operation-count").textContent = String((logs.operations || []).length);
|
|
1659
1666
|
document.getElementById("supervisor-surface-meta").textContent = "pm2 home: " + (health.pm2_home || "—");
|
|
1660
|
-
|
|
1667
|
+
// Name the file actually being shown. It said events.jsonl while rendering
|
|
1668
|
+
// the daemon log, which makes the card unverifiable — you cannot go look at
|
|
1669
|
+
// the file it claims to be tailing.
|
|
1670
|
+
document.getElementById("supervisor-log-path").textContent =
|
|
1671
|
+
(daemonLog && daemonLog.log_path) || logs.log_path || "events.jsonl";
|
|
1661
1672
|
// Replacing innerHTML resets scrollTop to 0. The surfaces list is taller
|
|
1662
1673
|
// than its box, so on every poll tick the row you were looking at — or had
|
|
1663
1674
|
// just selected — scrolled out from under you. That is the "jumps up and
|
|
@@ -1713,13 +1724,22 @@ function selectSupervisorSurface(compositeId, name) {
|
|
|
1713
1724
|
function renderSupervisorCmdbar() {
|
|
1714
1725
|
const bar = document.getElementById("supervisor-cmdbar");
|
|
1715
1726
|
if (!bar) return;
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1727
|
+
// The buttons are ALWAYS rendered — disabled until a surface is selected,
|
|
1728
|
+
// never hidden. The previous version emitted only a "Select a surface below"
|
|
1729
|
+
// sentence and materialised the buttons on click, so an operator who had not
|
|
1730
|
+
// clicked yet saw no commands at all and had no way to know the panel had
|
|
1731
|
+
// any. "The commands are missing" was an accurate report of what was on
|
|
1732
|
+
// screen. A control you cannot see is a control that does not exist.
|
|
1733
|
+
const sel = selectedSupervisorSurface;
|
|
1734
|
+
const enable = Boolean(sel);
|
|
1735
|
+
const label = sel
|
|
1736
|
+
? '<span class="supervisor-cmdbar-name">' + htmlEscape(sel.name) + '</span>'
|
|
1737
|
+
: '<span class="supervisor-cmdbar-empty">Select a surface →</span>';
|
|
1738
|
+
bar.innerHTML = label + SUPERVISOR_SURFACE_ACTIONS.map(a =>
|
|
1739
|
+
'<button class="supervisor-action" data-supervisor-action="' + a + '"'
|
|
1740
|
+
+ (enable ? ' onclick="runSupervisorSurface(' + jsArg(sel.id) + ',' + jsArg(a) + ')"' : ' disabled')
|
|
1741
|
+
+ '>' + a + '</button>').join("")
|
|
1742
|
+
+ (enable ? '' : '');
|
|
1723
1743
|
}
|
|
1724
1744
|
|
|
1725
1745
|
function renderSupervisorSurface(surface) {
|
|
@@ -4550,8 +4570,19 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
|
|
|
4550
4570
|
fs.closeSync(fd);
|
|
4551
4571
|
const text = buf.toString("utf8");
|
|
4552
4572
|
// Drop the first line when we started mid-file — it is a partial line.
|
|
4553
|
-
|
|
4554
|
-
|
|
4573
|
+
let all = text.split(/\r?\n/).filter(Boolean);
|
|
4574
|
+
if (start > 0) all = all.slice(1);
|
|
4575
|
+
// Strip routine HTTP access lines. The dashboard itself polls /health,
|
|
4576
|
+
// /ping, /builds, /tunnel, /v1/surfaces, /v1/logs and /v1/daemon-log, so
|
|
4577
|
+
// an unfiltered tail is almost entirely the dashboard watching itself —
|
|
4578
|
+
// which is exactly what an operator sees as "it just has bullshit in
|
|
4579
|
+
// it". What belongs here is what the daemon DID: operations, errors,
|
|
4580
|
+
// startup, auth events. Pass `?raw=1` for the unfiltered tail.
|
|
4581
|
+
if (url.searchParams.get("raw") !== "1") {
|
|
4582
|
+
const NOISE = /\s(GET|HEAD)\s+\/(ping|health|builds|tunnel|v1\/(surfaces|logs|daemon-log|plugins)|favicon\.ico)\b/;
|
|
4583
|
+
all = all.filter((l) => !NOISE.test(l));
|
|
4584
|
+
}
|
|
4585
|
+
const rows = all.slice(-lines);
|
|
4555
4586
|
return ok(res, {
|
|
4556
4587
|
schema: "clauth.daemon.log.v1",
|
|
4557
4588
|
log_path: LOG_FILE,
|