@aria-framework/ai 0.14.3 → 0.15.2
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/browser/ai-panels.js +131 -0
- package/index.js +261 -245
- package/lmxStatus.js +125 -0
- package/lmxStore.js +188 -0
- package/lmxVerify.js +395 -0
- package/package.json +53 -49
- package/views/ai/lmx-stack.ejs +324 -0
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
<%# One supervised stack, as a folding panel.
|
|
2
|
+
────────────────────────────────────────────────────────────────────────────────────────────
|
|
3
|
+
A STACK IS A CONTAINER, not an endpoint. Its address is discovered, its model is a fact the
|
|
4
|
+
supervisor reports, and unfolding it lists engines rather than settings. The header reads
|
|
5
|
+
identity, kind, status, and then A COUNT OF WHAT DEPENDS ON IT — because the question anybody
|
|
6
|
+
has before touching a machine is "if this goes away, what stops working?".
|
|
7
|
+
|
|
8
|
+
FOLDED IS THE DEFAULT ONCE STABLE, so the folded line has to carry the whole verdict: status,
|
|
9
|
+
counts, all three credentials, and when it was last checked. Folding may hide detail; it must
|
|
10
|
+
never hide the reason you would have opened it. The app this was written for previously showed
|
|
11
|
+
a card with name, id and URL — none of which change when you paste a token — so a save that
|
|
12
|
+
worked and one that was discarded were pixel-identical.
|
|
13
|
+
|
|
14
|
+
A PANEL WITH A PROBLEM IS OPEN IN THE SERVER'S HTML, never opened later by script. If attention
|
|
15
|
+
depended on JavaScript, the one state that must never be missed would be the state that
|
|
16
|
+
disappears when a script fails to load.
|
|
17
|
+
|
|
18
|
+
Locals:
|
|
19
|
+
inst a supervisor row, merged with lmxStatus.describeStack() and carrying
|
|
20
|
+
`report` (lmxVerify), `pin` (lmxVerify.readPin), `creds` {statusToken, enginesKey}
|
|
21
|
+
canEdit render the controls at all
|
|
22
|
+
csrfToken () => token, for the forms
|
|
23
|
+
basePath where this app mounts its AI admin, e.g. '/admin/ai'. NOT hardcoded: the routes
|
|
24
|
+
are the consumer's, and only the consumer knows where they live.
|
|
25
|
+
newAnchor where Edit sends somebody to change the stack, e.g. '#lmx-new'
|
|
26
|
+
routeLabel optional (id) => human name for a job; the id is used when absent
|
|
27
|
+
%>
|
|
28
|
+
<%
|
|
29
|
+
// DISTINCT NAMES, deliberately. `var canEdit = (typeof canEdit === "undefined") ? ... : canEdit`
|
|
30
|
+
// reads as a defaulting idiom and is not one: `var` hoists, so inside this template the name is
|
|
31
|
+
// already declared and undefined when the typeof runs. The test is therefore always true, the
|
|
32
|
+
// passed-in local is shadowed, and every consumer silently gets the default.
|
|
33
|
+
var _edit = (typeof canEdit !== 'undefined') && canEdit;
|
|
34
|
+
var _base = (typeof basePath !== 'undefined' && basePath) ? basePath : '/admin/ai';
|
|
35
|
+
var _anchor = (typeof newAnchor !== 'undefined' && newAnchor) ? newAnchor : '#lmx-new';
|
|
36
|
+
var _label = (typeof routeLabel === 'function') ? routeLabel : function (x) { return x; };
|
|
37
|
+
var _csrf = (typeof csrfToken === 'function') ? csrfToken : function () { return ''; };
|
|
38
|
+
var _ago = function (iso) {
|
|
39
|
+
if (!iso) return null;
|
|
40
|
+
var secs = Math.max(0, Math.round((Date.now() - new Date(iso).getTime()) / 1000));
|
|
41
|
+
if (secs < 60) return secs + 's ago';
|
|
42
|
+
if (secs < 3600) return Math.round(secs / 60) + 'm ago';
|
|
43
|
+
return Math.round(secs / 3600) + 'h ago';
|
|
44
|
+
};
|
|
45
|
+
var _glyph = { pass: '✔', fail: '✖', warn: '⚠', skip: '—' };
|
|
46
|
+
var _gcls = { pass: 'text-success', fail: 'text-danger', warn: 'text-warning', skip: 'text-body-tertiary' };
|
|
47
|
+
// ── TONE, NOT COLOUR ────────────────────────────────────────────────────────────────────────
|
|
48
|
+
// A TINT rather than a solid fill. A row can carry four state pills at once, and as saturated
|
|
49
|
+
// blocks they read as traffic lights — at which point nothing looks urgent because everything
|
|
50
|
+
// does. The `-subtle` pairs are Bootstrap's own and are defined for BOTH themes, so these stay
|
|
51
|
+
// legible on either ground; a hand-picked hex would be right on one and wrong on the other.
|
|
52
|
+
var _pill = 'badge rounded-pill border fw-semibold';
|
|
53
|
+
var _tone = {
|
|
54
|
+
ok: 'bg-success-subtle text-success-emphasis border-success-subtle',
|
|
55
|
+
warn: 'bg-warning-subtle text-warning-emphasis border-warning-subtle',
|
|
56
|
+
bad: 'bg-danger-subtle text-danger-emphasis border-danger-subtle',
|
|
57
|
+
mute: 'bg-body-secondary text-body-secondary border'
|
|
58
|
+
};
|
|
59
|
+
// The dot inherits the pill's colour, so state is one decision rather than two that can disagree.
|
|
60
|
+
var _dot = '<span class="d-inline-block rounded-circle align-middle" style="width:.4rem;height:.4rem;background:currentColor"></span>';
|
|
61
|
+
// A COUNT IS NOT A STATE, so it never wears a dot — the status pill beside it owns that job.
|
|
62
|
+
var _count = 'badge rounded-pill border bg-body-secondary text-body-secondary font-monospace fw-normal';
|
|
63
|
+
// What an engine IS, rather than how it is doing: quiet, uppercase, no colour of its own.
|
|
64
|
+
var _role = 'badge border bg-body-tertiary text-body-secondary text-uppercase fw-semibold';
|
|
65
|
+
// The rows for engines actually being relied on, tinted with the app's own brand so the half of
|
|
66
|
+
// the list that matters is visible before a word is read.
|
|
67
|
+
var _inUse = 'background: rgba(var(--bs-primary-rgb, 13,110,253), .06)';
|
|
68
|
+
|
|
69
|
+
var r = inst.report;
|
|
70
|
+
var _open = !!inst.attention;
|
|
71
|
+
// NOT CHECKED is its own state, distinct from both answering and broken. A stack nobody has asked
|
|
72
|
+
// since the last restart is not a stack in trouble, and colouring it as one would train an
|
|
73
|
+
// operator to ignore the colour.
|
|
74
|
+
var pillCls = !r ? _tone.mute
|
|
75
|
+
: (r.ok ? _tone.ok : (r.level === 'bad' ? _tone.bad : _tone.warn));
|
|
76
|
+
var pillText = !r ? 'not checked' : (r.ok ? 'answering' : 'needs attention');
|
|
77
|
+
%>
|
|
78
|
+
<div class="card mb-3 <%= _open ? 'border-warning' : '' %>" data-panel="lmx-<%= inst.id %>"<% if (_open) { %> data-panel-attention<% } %>
|
|
79
|
+
data-lmx-id="<%= inst.id %>" data-lmx-label="<%= inst.label || inst.id %>" data-lmx-url="<%= inst.status_url %>"
|
|
80
|
+
<%# WHAT EDIT PREFILLS. The certificate IS carried, because it is public — it is not even
|
|
81
|
+
encrypted at rest — and an operator opening Edit to a blank certificate box has no way to
|
|
82
|
+
tell a stored one from none at all. The two tokens are carried only as LENGTHS, which is
|
|
83
|
+
the most that can be said about a write-only secret and, as it happens, exactly enough to
|
|
84
|
+
notice the same value pasted into both fields. %>
|
|
85
|
+
data-lmx-cert="<%= inst.caCert || '' %>"
|
|
86
|
+
data-lmx-token-len="<%= (inst.creds && inst.creds.statusTokenLength) || '' %>"
|
|
87
|
+
data-lmx-key-len="<%= (inst.creds && inst.creds.enginesKeyLength) || '' %>">
|
|
88
|
+
<%# THE TOGGLE AND THE ACTIONS ARE SIBLINGS, not nested. A <button> may not contain a link
|
|
89
|
+
or another button — the markup parses unpredictably and the inner control stops being
|
|
90
|
+
reachable by keyboard, which would put Check and Edit behind a mouse. %>
|
|
91
|
+
<div class="d-flex gap-2 align-items-start p-3">
|
|
92
|
+
<button type="button" class="btn text-start border-0 p-0 flex-grow-1 d-flex gap-2 align-items-start"
|
|
93
|
+
data-panel-toggle="lmx-<%= inst.id %>" aria-expanded="<%= _open ? 'true' : 'false' %>"
|
|
94
|
+
aria-controls="body-lmx-<%= inst.id %>">
|
|
95
|
+
<span class="panel-chev text-body-secondary" aria-hidden="true">›</span>
|
|
96
|
+
<span class="flex-grow-1">
|
|
97
|
+
<span class="d-flex align-items-center gap-2 flex-wrap">
|
|
98
|
+
<strong><%= inst.label || inst.id %></strong>
|
|
99
|
+
<code class="small"><%= inst.id %></code>
|
|
100
|
+
<span class="<%= _role %>">lmx</span>
|
|
101
|
+
<span class="<%= _pill %> <%= pillCls %>"><%- _dot %> <%= pillText %></span>
|
|
102
|
+
<%# THE COUNT IS "WHAT AM I RELYING ON", not what exists. Active means added, enabled
|
|
103
|
+
and healthy in the stack's own document — the number that was missing when a
|
|
104
|
+
configured-but-broken engine looked exactly like a working one. %>
|
|
105
|
+
<span class="<%= _count %>">
|
|
106
|
+
<% if (r && r.engines) { %>
|
|
107
|
+
<%= inst.activeCount %> engine<%= inst.activeCount === 1 ? '' : 's' %> active · <%= inst.reportedCount %> reported<% if (inst.missingCount) { %> · <span class="text-danger"><%= inst.missingCount %> missing</span><% } %>
|
|
108
|
+
<% } else if (r) { %>
|
|
109
|
+
<%# CHECKED, BUT THE LIST DID NOT ARRIVE. "not checked yet" here would be a lie
|
|
110
|
+
about something that just happened 0 seconds ago, and would send somebody to
|
|
111
|
+
press Check again rather than read the reason sitting directly below. %>
|
|
112
|
+
<%= inst.added.length %> added · engines could not be listed
|
|
113
|
+
<% } else { %>
|
|
114
|
+
<%= inst.added.length %> added · not checked yet
|
|
115
|
+
<% } %>
|
|
116
|
+
</span>
|
|
117
|
+
</span>
|
|
118
|
+
<span class="d-block small text-body-secondary font-monospace mt-1" style="word-break:break-all">
|
|
119
|
+
<%= inst.status_url %>
|
|
120
|
+
· token <%= inst.creds.statusToken ? '✔' : '✖' %>
|
|
121
|
+
· key <%= inst.creds.enginesKey ? '✔' : '✖' %>
|
|
122
|
+
· cert <% if (!inst.pin.present) { %>none<% } else if (!inst.pin.valid) { %><span class="text-danger">unreadable</span><% } else if (inst.pin.expired) { %><span class="text-danger">EXPIRED</span><% } else if (inst.pin.expiringSoon) { %><span class="text-warning"><%= inst.pin.expiresDays %>d left</span><% } else { %>✔<% } %>
|
|
123
|
+
<% if (r) { %>· checked <%= _ago(r.at) %><% } %>
|
|
124
|
+
<% if (!inst.enabled) { %>· <span class="<%= _pill %> <%= _tone.mute %>">disabled</span><% } %>
|
|
125
|
+
</span>
|
|
126
|
+
</span>
|
|
127
|
+
</button>
|
|
128
|
+
<% if (_edit) { %>
|
|
129
|
+
<span class="d-flex gap-2 align-items-center">
|
|
130
|
+
<form method="POST" action="<%= _base %>/lmx/<%= inst.id %>/check">
|
|
131
|
+
<input type="hidden" name="_csrf" value="<%= _csrf() %>">
|
|
132
|
+
<button type="submit" class="btn btn-sm btn-outline-secondary">Refresh</button>
|
|
133
|
+
</form>
|
|
134
|
+
<a class="btn btn-sm btn-outline-secondary" href="<%= _anchor %>"
|
|
135
|
+
data-lmx-edit="<%= inst.id %>">Edit</a>
|
|
136
|
+
</span>
|
|
137
|
+
<% } %>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<div id="body-lmx-<%= inst.id %>" class="border-top"<% if (!_open) { %> hidden<% } %>>
|
|
141
|
+
|
|
142
|
+
<%# THE LAST VERIFICATION, per check. Never a single line: "401" named neither of the two
|
|
143
|
+
credentials it could have been, which is exactly how an engines key pasted into the
|
|
144
|
+
status token's field stayed hidden. %>
|
|
145
|
+
<% if (r) { %>
|
|
146
|
+
<div class="p-3 border-bottom">
|
|
147
|
+
<div class="small text-uppercase fw-semibold text-body-secondary mb-2" style="letter-spacing:.08em">
|
|
148
|
+
Last checked <%= _ago(r.at) %>
|
|
149
|
+
</div>
|
|
150
|
+
<% r.checks.forEach(function (c) { %>
|
|
151
|
+
<div class="d-flex gap-2 small font-monospace">
|
|
152
|
+
<span class="<%= _gcls[c.status] || '' %>" style="width:1rem"><%= _glyph[c.status] || '' %></span>
|
|
153
|
+
<span class="<%= c.status === 'skip' ? 'text-body-tertiary' : '' %>"><%= c.text %></span>
|
|
154
|
+
</div>
|
|
155
|
+
<% }); %>
|
|
156
|
+
</div>
|
|
157
|
+
<% } else { %>
|
|
158
|
+
<div class="p-3 border-bottom small text-body-secondary">
|
|
159
|
+
This stack has not been checked since the last restart.
|
|
160
|
+
<%# NOT PROBED ON RENDER, deliberately: opening a settings page is not evidence that
|
|
161
|
+
anything changed, and a sleeping machine would hold the whole page while it timed
|
|
162
|
+
out. Check asks, when somebody wants to know. %>
|
|
163
|
+
Press <strong>Refresh</strong> to ask it now.
|
|
164
|
+
</div>
|
|
165
|
+
<% } %>
|
|
166
|
+
|
|
167
|
+
<%# ── ENGINES IN USE ── %>
|
|
168
|
+
<% if (inst.added.length) { %>
|
|
169
|
+
<div class="px-3 py-2 bg-body-tertiary d-flex justify-content-between small text-body-secondary">
|
|
170
|
+
<span class="text-uppercase fw-semibold" style="letter-spacing:.08em">In use — <%= inst.added.length %> engine<%= inst.added.length === 1 ? "" : "s" %></span>
|
|
171
|
+
<span class="text-uppercase fw-semibold" style="letter-spacing:.08em">endpoint · jobs served</span>
|
|
172
|
+
</div>
|
|
173
|
+
<% inst.added.forEach(function (a) { %>
|
|
174
|
+
<div class="d-flex justify-content-between align-items-start gap-3 border-top p-3<% if (a.missing) { %> bg-danger-subtle<% } %>"<% if (!a.missing) { %> style="<%= _inUse %>"<% } %>>
|
|
175
|
+
<div>
|
|
176
|
+
<div class="d-flex align-items-center gap-2 flex-wrap">
|
|
177
|
+
<strong><%= a.row.lmx_engine %></strong>
|
|
178
|
+
<% if (a.missing) { %>
|
|
179
|
+
<span class="<%= _pill %> <%= _tone.bad %>"><%- _dot %> not reported</span>
|
|
180
|
+
<% } else if (a.engine) { %>
|
|
181
|
+
<span class="<%= _pill %> <%= a.engine.state === 'healthy' ? _tone.ok : _tone.warn %>"><%- _dot %> <%= a.engine.state %></span>
|
|
182
|
+
<% if (a.engine.role) { %><span class="<%= _role %>"><%= a.engine.role %></span><% } %>
|
|
183
|
+
<% } %>
|
|
184
|
+
<% if (!Number(a.row.enabled)) { %><span class="<%= _pill %> <%= _tone.mute %>">disabled</span><% } %>
|
|
185
|
+
</div>
|
|
186
|
+
<% if (a.engine) { %>
|
|
187
|
+
<div class="small text-body-tertiary font-monospace mt-1">
|
|
188
|
+
<%= [a.engine.modelName || a.engine.model, a.engine.quantisation,
|
|
189
|
+
a.engine.parameters ? (a.engine.parameters / 1e9).toFixed(1).replace(/\.0$/, '') + 'B' : null,
|
|
190
|
+
a.engine.device,
|
|
191
|
+
a.engine.deviceTotalMiB ? Math.round(a.engine.deviceTotalMiB / 1024) + ' GiB' : null,
|
|
192
|
+
a.engine.maxInputTokens ? Number(a.engine.maxInputTokens).toLocaleString() + ' tok/slot' : null,
|
|
193
|
+
a.engine.slots ? a.engine.slots + (a.engine.slots === 1 ? ' slot' : ' slots') : null,
|
|
194
|
+
a.engine.dimensions ? a.engine.dimensions + ' dims' : null]
|
|
195
|
+
.filter(Boolean).join(' · ') %>
|
|
196
|
+
</div>
|
|
197
|
+
<%# WHICH FLAG THIS ENGINE GETS, on an engine already being relied on — not only on
|
|
198
|
+
one somebody might add. Getting it wrong is silent: the model spends its whole
|
|
199
|
+
budget thinking and returns nothing, with no error at all, and this row is the
|
|
200
|
+
only place anybody would look to find out which flag is being sent. %>
|
|
201
|
+
<% if (a.engine.reasoning) { %>
|
|
202
|
+
<div class="small text-body-secondary mt-1">reasoning: <code><%= a.engine.reasoning %></code></div>
|
|
203
|
+
<% } else if (a.engine.role === 'chat') { %>
|
|
204
|
+
<div class="small text-warning mt-1">no known reasoning flag for this model family — neither will be sent</div>
|
|
205
|
+
<% } %>
|
|
206
|
+
<% } %>
|
|
207
|
+
<%# WHAT STILL POINTS AT IT. A missing engine whose jobs nobody has repointed is
|
|
208
|
+
an endpoint that will fail every call — the same silent-but-configured shape
|
|
209
|
+
as the credential problem, so it names the jobs rather than only itself. %>
|
|
210
|
+
<div class="small mt-1 <%= a.missing ? 'text-danger fw-semibold' : 'text-body-secondary' %>">
|
|
211
|
+
<a href="<%= _base %>?edit=<%= encodeURIComponent(a.row.id) %>" class="text-decoration-none"><%= a.row.id %></a>
|
|
212
|
+
<% if (a.routes.length) { %>
|
|
213
|
+
· <%= a.routes.map(function (x) { return _label(x.id); }).join(', ') %>
|
|
214
|
+
<% } else { %>
|
|
215
|
+
· serves no jobs
|
|
216
|
+
<% } %>
|
|
217
|
+
</div>
|
|
218
|
+
<% if (a.missing) { %>
|
|
219
|
+
<div class="small text-danger mt-1">
|
|
220
|
+
The stack no longer lists this engine. Either point its jobs elsewhere, or remove the endpoint.
|
|
221
|
+
</div>
|
|
222
|
+
<% } %>
|
|
223
|
+
</div>
|
|
224
|
+
<div class="d-flex gap-2">
|
|
225
|
+
<%# TEST THIS ENGINE, not whatever is currently serving. An engine you have adopted is an
|
|
226
|
+
endpoint like any other, and the reason to test one is precisely that it is NOT the
|
|
227
|
+
one answering right now — verifying a fallback before it is needed is the point of
|
|
228
|
+
having one. %>
|
|
229
|
+
<form method="POST" action="<%= _base %>/<%= encodeURIComponent(a.row.id) %>/test">
|
|
230
|
+
<input type="hidden" name="_csrf" value="<%= _csrf() %>">
|
|
231
|
+
<button type="submit" class="btn btn-sm btn-outline-secondary">Test</button>
|
|
232
|
+
</form>
|
|
233
|
+
<a class="btn btn-sm btn-outline-secondary" href="<%= _base %>?edit=<%= encodeURIComponent(a.row.id) %>">Settings</a>
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
<% }); %>
|
|
237
|
+
<% } %>
|
|
238
|
+
|
|
239
|
+
<%# ── ENGINES AVAILABLE ── %>
|
|
240
|
+
<% if (inst.available && inst.available.length) { %>
|
|
241
|
+
<div class="px-3 py-2 bg-body-tertiary d-flex justify-content-between small text-body-secondary border-top">
|
|
242
|
+
<span class="text-uppercase fw-semibold" style="letter-spacing:.08em">Also on this stack — not in use</span>
|
|
243
|
+
<span class="text-uppercase fw-semibold" style="letter-spacing:.08em"><%= inst.available.length %></span>
|
|
244
|
+
</div>
|
|
245
|
+
<% inst.available.forEach(function (e) { %>
|
|
246
|
+
<div class="d-flex justify-content-between align-items-start gap-3 border-top p-3">
|
|
247
|
+
<div>
|
|
248
|
+
<div class="d-flex align-items-center gap-2 flex-wrap">
|
|
249
|
+
<strong><%= e.label || e.name %></strong>
|
|
250
|
+
<code class="small"><%= e.name %></code>
|
|
251
|
+
<span class="<%= _pill %> <%= e.state === 'healthy' ? _tone.ok : _tone.warn %>"><%- _dot %> <%= e.state || 'unknown' %></span>
|
|
252
|
+
<span class="<%= _role %>"><%= e.role || '?' %></span>
|
|
253
|
+
</div>
|
|
254
|
+
<div class="small text-body-tertiary font-monospace mt-1">
|
|
255
|
+
<%= [e.modelName || e.model, e.quantisation, e.device,
|
|
256
|
+
e.maxInputTokens ? Number(e.maxInputTokens).toLocaleString() + ' tok/slot' : null,
|
|
257
|
+
e.slots ? e.slots + (e.slots === 1 ? ' slot' : ' slots') : null,
|
|
258
|
+
e.dimensions ? e.dimensions + ' dims' : null].filter(Boolean).join(' · ') %>
|
|
259
|
+
</div>
|
|
260
|
+
<%# WHICH REASONING FLAG THIS MODEL NEEDS. Getting it wrong is silent: the model
|
|
261
|
+
spends its whole budget thinking and returns nothing, with no error at all. %>
|
|
262
|
+
<% if (e.reasoning) { %>
|
|
263
|
+
<div class="small text-body-secondary mt-1">reasoning: <code><%= e.reasoning %></code></div>
|
|
264
|
+
<% } else if (e.role === 'chat') { %>
|
|
265
|
+
<div class="small text-warning mt-1">no known reasoning flag for this model family — neither will be sent</div>
|
|
266
|
+
<% } %>
|
|
267
|
+
</div>
|
|
268
|
+
<% if (_edit) { %>
|
|
269
|
+
<form method="POST" action="<%= _base %>/lmx/<%= inst.id %>/adopt">
|
|
270
|
+
<input type="hidden" name="_csrf" value="<%= _csrf() %>">
|
|
271
|
+
<input type="hidden" name="engine" value="<%= e.name %>">
|
|
272
|
+
<input type="hidden" name="label" value="<%= e.label || e.name %>">
|
|
273
|
+
<input type="hidden" name="role" value="<%= e.role || '' %>">
|
|
274
|
+
<input type="hidden" name="max_input_tokens" value="<%= e.maxInputTokens || '' %>">
|
|
275
|
+
<button type="submit" class="btn btn-sm btn-primary">Add</button>
|
|
276
|
+
</form>
|
|
277
|
+
<% } %>
|
|
278
|
+
</div>
|
|
279
|
+
<% }); %>
|
|
280
|
+
<% } %>
|
|
281
|
+
|
|
282
|
+
<%# ── CREDENTIALS: what is set, never what it is ──
|
|
283
|
+
THE LENGTH IS SHOWN because it is the one property of a write-only secret that can be
|
|
284
|
+
checked by eye, and because two credentials of similar length in adjacent fields is how the
|
|
285
|
+
wrong one got pasted into both. Seeing "43 chars" beside a token you believe is 50 long is
|
|
286
|
+
the cheapest possible way to notice. It reveals nothing: a length is not a secret, and the
|
|
287
|
+
alternative was an operator with no way at all to tell two stored values apart. %>
|
|
288
|
+
<div class="px-3 py-2 bg-body-tertiary border-top small text-body-secondary d-flex justify-content-between align-items-center">
|
|
289
|
+
<span class="text-uppercase fw-semibold" style="letter-spacing:.08em">Credentials</span>
|
|
290
|
+
<% if (_edit) { %>
|
|
291
|
+
<a class="btn btn-sm btn-outline-secondary py-0" href="<%= _anchor %>" data-lmx-edit="<%= inst.id %>">Edit</a>
|
|
292
|
+
<% } %>
|
|
293
|
+
</div>
|
|
294
|
+
<div class="p-3 border-top d-flex gap-2 flex-wrap">
|
|
295
|
+
<span class="badge border bg-body-secondary text-body-secondary font-monospace fw-normal">
|
|
296
|
+
<span class="<%= inst.creds.statusToken ? 'text-success' : 'text-danger' %>"><%= inst.creds.statusToken ? '✔' : '✖' %></span>
|
|
297
|
+
status token<% if (inst.creds.statusTokenLength) { %> · <%= inst.creds.statusTokenLength %> chars<% } %>
|
|
298
|
+
</span>
|
|
299
|
+
<span class="badge border bg-body-secondary text-body-secondary font-monospace fw-normal">
|
|
300
|
+
<span class="<%= inst.creds.enginesKey ? 'text-success' : 'text-danger' %>"><%= inst.creds.enginesKey ? '✔' : '✖' %></span>
|
|
301
|
+
engines key<% if (inst.creds.enginesKeyLength) { %> · <%= inst.creds.enginesKeyLength %> chars<% } %>
|
|
302
|
+
</span>
|
|
303
|
+
<span class="badge border font-monospace fw-normal <%= (inst.pin.expired || !inst.pin.valid) ? _tone.bad : (inst.pin.expiringSoon ? _tone.warn : 'bg-body-secondary text-body-secondary') %>">
|
|
304
|
+
<% if (!inst.pin.present) { %>no certificate pinned
|
|
305
|
+
<% } else if (!inst.pin.valid) { %>certificate unreadable
|
|
306
|
+
<% } else { %>cert <%= inst.pin.fingerprint %> · expires <%= inst.pin.expires.toISOString().slice(0, 10) %><% if (inst.pin.expiringSoon) { %> · <%= inst.pin.expiresDays %>d left<% } %><% } %>
|
|
307
|
+
</span>
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
<% if (_edit) { %>
|
|
311
|
+
<div class="p-3 border-top d-flex gap-2">
|
|
312
|
+
<form method="POST" action="<%= _base %>/lmx/<%= inst.id %>/check">
|
|
313
|
+
<input type="hidden" name="_csrf" value="<%= _csrf() %>">
|
|
314
|
+
<button type="submit" class="btn btn-sm btn-outline-secondary">Check now</button>
|
|
315
|
+
</form>
|
|
316
|
+
<form method="POST" action="<%= _base %>/lmx/<%= inst.id %>/delete"
|
|
317
|
+
data-confirm="Remove the “<%= inst.label || inst.id %>” supervisor?">
|
|
318
|
+
<input type="hidden" name="_csrf" value="<%= _csrf() %>">
|
|
319
|
+
<button type="submit" class="btn btn-sm btn-outline-danger">Remove</button>
|
|
320
|
+
</form>
|
|
321
|
+
</div>
|
|
322
|
+
<% } %>
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|