airlock-bot 0.2.14 → 0.2.15
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../src/hitl/providers/dashboard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../../src/hitl/providers/dashboard.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAO9E,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,qBAAsB,YAAW,YAAY;IAMtD,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,WAAW;IANrB,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,OAAO,CAAoE;IACnF,OAAO,CAAC,OAAO,CAAuC;gBAG5C,MAAM,EAAE,mBAAmB,EAC3B,WAAW,EAAE,WAAW;IAG5B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAwGrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAe3B,MAAM,CAAC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAQnD,OAAO,CAAC,SAAS;CAUlB"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { createServer } from 'http';
|
|
2
2
|
import { childLogger } from '../../util/logger.js';
|
|
3
|
+
import { VERSION } from '../../version.js';
|
|
3
4
|
const log = childLogger('hitl-dashboard');
|
|
5
|
+
let latestVersionCache = null;
|
|
6
|
+
const CACHE_TTL_MS = 60 * 60 * 1000; // 1 hour
|
|
4
7
|
export class DashboardHitlProvider {
|
|
5
8
|
config;
|
|
6
9
|
approvalApi;
|
|
@@ -57,6 +60,32 @@ export class DashboardHitlProvider {
|
|
|
57
60
|
res.end('ok');
|
|
58
61
|
return;
|
|
59
62
|
}
|
|
63
|
+
if (req.method === 'GET' && url.pathname === '/version') {
|
|
64
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
65
|
+
res.end(JSON.stringify({ version: VERSION }));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (req.method === 'GET' && url.pathname === '/version/latest') {
|
|
69
|
+
const now = Date.now();
|
|
70
|
+
if (latestVersionCache && now - latestVersionCache.fetchedAt < CACHE_TTL_MS) {
|
|
71
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
72
|
+
res.end(JSON.stringify({ latest: latestVersionCache.version }));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
fetch('https://registry.npmjs.org/airlock-bot/latest')
|
|
76
|
+
.then((r) => r.json())
|
|
77
|
+
.then((data) => {
|
|
78
|
+
latestVersionCache = { version: data.version, fetchedAt: now };
|
|
79
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
80
|
+
res.end(JSON.stringify({ latest: data.version }));
|
|
81
|
+
})
|
|
82
|
+
.catch((err) => {
|
|
83
|
+
log.warn({ err }, 'Failed to fetch latest version from npm');
|
|
84
|
+
res.writeHead(502, { 'Content-Type': 'application/json' });
|
|
85
|
+
res.end(JSON.stringify({ error: 'Failed to fetch latest version' }));
|
|
86
|
+
});
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
60
89
|
res.writeHead(404);
|
|
61
90
|
res.end('not found');
|
|
62
91
|
});
|
|
@@ -132,9 +161,11 @@ const DASHBOARD_HTML = `<!DOCTYPE html>
|
|
|
132
161
|
#settings label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #c9d1d9; cursor: pointer; margin-bottom: 6px; }
|
|
133
162
|
#settings label:last-child { margin-bottom: 0; }
|
|
134
163
|
#empty { color: #484f58; font-style: italic; }
|
|
135
|
-
.card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 16px; margin-bottom: 12px; }
|
|
164
|
+
.card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 16px; margin-bottom: 12px; cursor: pointer; transition: border-color 0.15s; }
|
|
165
|
+
.card:hover { border-color: #58a6ff; }
|
|
136
166
|
.card.approved { border-color: #238636; opacity: 0.5; }
|
|
137
167
|
.card.denied { border-color: #da3633; opacity: 0.5; }
|
|
168
|
+
.card .actions { position: relative; z-index: 2; }
|
|
138
169
|
.tool { font-weight: 600; color: #f0883e; font-size: 15px; }
|
|
139
170
|
.agent { color: #8b949e; font-size: 13px; margin-top: 2px; }
|
|
140
171
|
.args { font-family: "SF Mono", Monaco, monospace; font-size: 12px; background: #0d1117; border-radius: 4px; padding: 8px; margin: 8px 0; white-space: pre-wrap; word-break: break-all; color: #8b949e; max-height: 120px; overflow-y: auto; }
|
|
@@ -145,10 +176,40 @@ const DASHBOARD_HTML = `<!DOCTYPE html>
|
|
|
145
176
|
.btn-approve:hover { background: #2ea043; }
|
|
146
177
|
.btn-deny { background: #21262d; color: #f85149; border: 1px solid #da3633; }
|
|
147
178
|
.btn-deny:hover { background: #da3633; color: #fff; }
|
|
179
|
+
.btn kbd { display: inline-block; background: rgba(255,255,255,0.1); border-radius: 3px; padding: 0 4px; font-size: 11px; font-family: inherit; margin-left: 6px; opacity: 0.7; }
|
|
148
180
|
.status { font-size: 12px; font-weight: 600; margin-top: 8px; }
|
|
149
181
|
.status.approved { color: #3fb950; }
|
|
150
182
|
.status.denied { color: #f85149; }
|
|
183
|
+
.version-info { margin-top: 12px; font-size: 12px; color: #484f58; }
|
|
184
|
+
.version-info .current { color: #8b949e; }
|
|
185
|
+
.version-info .update-available { color: #f0883e; margin-top: 4px; }
|
|
186
|
+
.version-info .update-available code { background: #21262d; padding: 2px 6px; border-radius: 4px; font-size: 11px; }
|
|
187
|
+
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100; justify-content: center; align-items: center; }
|
|
188
|
+
.modal-overlay.open { display: flex; }
|
|
189
|
+
.modal { background: #161b22; border: 1px solid #30363d; border-radius: 10px; width: 90vw; max-width: 600px; max-height: 80vh; display: flex; flex-direction: column; animation: modalIn 0.15s ease-out; }
|
|
190
|
+
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
|
|
191
|
+
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid #30363d; }
|
|
192
|
+
.modal-header .tool { margin: 0; }
|
|
193
|
+
.modal-close { background: none; border: none; color: #8b949e; font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 4px; }
|
|
194
|
+
.modal-close:hover { background: #21262d; color: #c9d1d9; }
|
|
195
|
+
.modal-body { padding: 16px; overflow-y: auto; flex: 1; }
|
|
196
|
+
.modal-body .detail-label { font-size: 11px; color: #484f58; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 12px; margin-bottom: 4px; }
|
|
197
|
+
.modal-body .detail-label:first-child { margin-top: 0; }
|
|
198
|
+
.modal-body .detail-value { font-size: 13px; color: #c9d1d9; }
|
|
199
|
+
.modal-body .detail-value.mono { font-family: "SF Mono", Monaco, monospace; font-size: 12px; color: #8b949e; }
|
|
200
|
+
.modal-body .args-full { max-height: 50vh; overflow-y: auto; }
|
|
201
|
+
.modal-body .arg-entry { margin-bottom: 10px; }
|
|
202
|
+
.modal-body .arg-entry:last-child { margin-bottom: 0; }
|
|
203
|
+
.modal-body .arg-key { font-family: "SF Mono", Monaco, monospace; font-size: 12px; color: #79c0ff; margin-bottom: 4px; }
|
|
204
|
+
.modal-body .arg-val { font-family: "SF Mono", Monaco, monospace; font-size: 12px; background: #0d1117; border-radius: 4px; padding: 10px; white-space: pre-wrap; word-break: break-word; color: #c9d1d9; overflow-x: auto; }
|
|
205
|
+
.modal-body .arg-val pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
|
|
206
|
+
.modal-body .arg-val code.hljs { background: transparent; padding: 0; }
|
|
207
|
+
.modal-footer { padding: 12px 16px; border-top: 1px solid #30363d; display: flex; gap: 8px; }
|
|
208
|
+
.modal-footer .status { margin: 0; padding: 6px 0; }
|
|
151
209
|
</style>
|
|
210
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/styles/github-dark.min.css" crossorigin="anonymous" referrerpolicy="no-referrer">
|
|
211
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.1/highlight.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></scr` +
|
|
212
|
+
`ipt>
|
|
152
213
|
</head>
|
|
153
214
|
<body>
|
|
154
215
|
<header>
|
|
@@ -158,37 +219,151 @@ const DASHBOARD_HTML = `<!DOCTYPE html>
|
|
|
158
219
|
<div id="settings">
|
|
159
220
|
<label><input type="checkbox" id="notifs" checked> Browser notifications</label>
|
|
160
221
|
<label><input type="checkbox" id="sound" checked> Sound</label>
|
|
222
|
+
<div class="version-info" id="version-info"></div>
|
|
161
223
|
</div>
|
|
162
224
|
<div id="list"><div id="empty">No pending requests</div></div>
|
|
225
|
+
<div class="modal-overlay" id="modal-overlay" onclick="closeModal(event)">
|
|
226
|
+
<div class="modal" onclick="event.stopPropagation()">
|
|
227
|
+
<div class="modal-header">
|
|
228
|
+
<div class="tool" id="modal-tool"></div>
|
|
229
|
+
<button class="modal-close" onclick="closeModal()">×</button>
|
|
230
|
+
</div>
|
|
231
|
+
<div class="modal-body" id="modal-body"></div>
|
|
232
|
+
<div class="modal-footer" id="modal-footer"></div>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
163
235
|
<script>
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
236
|
+
var list = document.getElementById('list');
|
|
237
|
+
var empty = document.getElementById('empty');
|
|
238
|
+
var cards = new Map();
|
|
239
|
+
var requestData = new Map();
|
|
167
240
|
|
|
168
241
|
// Settings — persisted in localStorage
|
|
169
|
-
|
|
170
|
-
|
|
242
|
+
var notifsEl = document.getElementById('notifs');
|
|
243
|
+
var soundEl = document.getElementById('sound');
|
|
171
244
|
|
|
172
245
|
notifsEl.checked = localStorage.getItem('airlock:notifs') === 'true';
|
|
173
246
|
soundEl.checked = localStorage.getItem('airlock:sound') !== 'false';
|
|
174
|
-
notifsEl.onchange = ()
|
|
175
|
-
soundEl.onchange = ()
|
|
247
|
+
notifsEl.onchange = function() { localStorage.setItem('airlock:notifs', notifsEl.checked); };
|
|
248
|
+
soundEl.onchange = function() { localStorage.setItem('airlock:sound', soundEl.checked); };
|
|
249
|
+
|
|
250
|
+
// Version check
|
|
251
|
+
(async function checkVersion() {
|
|
252
|
+
try {
|
|
253
|
+
var curRes = await fetch('/version').then(function(r) { return r.json(); });
|
|
254
|
+
var latestRes = await fetch('/version/latest').then(function(r) { return r.json(); });
|
|
255
|
+
var el = document.getElementById('version-info');
|
|
256
|
+
var html = '<div class="current">Version: v' + esc(curRes.version) + '</div>';
|
|
257
|
+
if (latestRes.latest && isNewer(latestRes.latest, curRes.version)) {
|
|
258
|
+
html += '<div class="update-available">New version available: v' + esc(latestRes.latest) + ' — run <code>npm update -g airlock-bot</code></div>';
|
|
259
|
+
}
|
|
260
|
+
el.innerHTML = html;
|
|
261
|
+
} catch (e) { /* ignore version check failures */ }
|
|
262
|
+
})();
|
|
263
|
+
|
|
264
|
+
function isNewer(latest, current) {
|
|
265
|
+
var a = latest.split('.').map(Number);
|
|
266
|
+
var b = current.split('.').map(Number);
|
|
267
|
+
for (var i = 0; i < 3; i++) {
|
|
268
|
+
if ((a[i] || 0) > (b[i] || 0)) return true;
|
|
269
|
+
if ((a[i] || 0) < (b[i] || 0)) return false;
|
|
270
|
+
}
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// Syntax highlight via highlight.js if loaded, otherwise plain escaped text
|
|
275
|
+
function highlight(code, lang) {
|
|
276
|
+
if (typeof hljs !== 'undefined') {
|
|
277
|
+
try {
|
|
278
|
+
if (lang) return hljs.highlight(code, { language: lang }).value;
|
|
279
|
+
return hljs.highlightAuto(code).value;
|
|
280
|
+
} catch (e) { /* fall through */ }
|
|
281
|
+
}
|
|
282
|
+
return esc(code);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// Render a single arg value — strings get displayed directly (with highlighting
|
|
286
|
+
// for multiline content), objects/arrays get JSON-formatted
|
|
287
|
+
function renderArgValue(val) {
|
|
288
|
+
if (typeof val === 'string') {
|
|
289
|
+
if (val.includes('\\n') && val.length > 60) {
|
|
290
|
+
return '<div class="arg-val"><pre><code>' + highlight(val) + '</code></pre></div>';
|
|
291
|
+
}
|
|
292
|
+
return '<div class="arg-val">' + esc(val) + '</div>';
|
|
293
|
+
}
|
|
294
|
+
var json = JSON.stringify(val, null, 2);
|
|
295
|
+
return '<div class="arg-val"><pre><code>' + highlight(json, 'json') + '</code></pre></div>';
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
var currentModalCode = null;
|
|
299
|
+
|
|
300
|
+
function openModal(code) {
|
|
301
|
+
var req = requestData.get(code);
|
|
302
|
+
if (!req) return;
|
|
303
|
+
currentModalCode = code;
|
|
304
|
+
var overlay = document.getElementById('modal-overlay');
|
|
305
|
+
document.getElementById('modal-tool').textContent = req.tool;
|
|
306
|
+
var body = document.getElementById('modal-body');
|
|
307
|
+
var html = '<div class="detail-label">Agent</div><div class="detail-value">' + esc(req.agentId) + '</div>';
|
|
308
|
+
html += '<div class="detail-label">Request Code</div><div class="detail-value mono">' + esc(req.code) + '</div>';
|
|
309
|
+
if (req.timeoutMs) {
|
|
310
|
+
html += '<div class="detail-label">Timeout</div><div class="detail-value">' + Math.round(req.timeoutMs / 1000) + 's</div>';
|
|
311
|
+
}
|
|
312
|
+
html += '<div class="detail-label">Arguments</div><div class="args-full">';
|
|
313
|
+
var keys = Object.keys(req.args || {});
|
|
314
|
+
if (keys.length === 0) {
|
|
315
|
+
html += '<div class="arg-val" style="color:#484f58">No arguments</div>';
|
|
316
|
+
} else {
|
|
317
|
+
for (var i = 0; i < keys.length; i++) {
|
|
318
|
+
html += '<div class="arg-entry"><div class="arg-key">' + esc(keys[i]) + '</div>' + renderArgValue(req.args[keys[i]]) + '</div>';
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
html += '</div>';
|
|
322
|
+
body.innerHTML = html;
|
|
323
|
+
|
|
324
|
+
var footer = document.getElementById('modal-footer');
|
|
325
|
+
var el = cards.get(code);
|
|
326
|
+
var resolved = el && (el.classList.contains('approved') || el.classList.contains('denied'));
|
|
327
|
+
if (resolved) {
|
|
328
|
+
var which = el.classList.contains('approved') ? 'approved' : 'denied';
|
|
329
|
+
footer.innerHTML = '<div class="status ' + which + '">' + which + '</div>';
|
|
330
|
+
} else {
|
|
331
|
+
footer.innerHTML = '<button class="btn btn-approve" onclick="actAndClose(\\x27approve\\x27,\\x27' + code + '\\x27)">Approve<kbd>A</kbd></button><button class="btn btn-deny" onclick="actAndClose(\\x27deny\\x27,\\x27' + code + '\\x27)">Deny<kbd>D</kbd></button>';
|
|
332
|
+
}
|
|
333
|
+
overlay.classList.add('open');
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function closeModal(e) {
|
|
337
|
+
if (e && e.target && e.target !== document.getElementById('modal-overlay')) return;
|
|
338
|
+
document.getElementById('modal-overlay').classList.remove('open');
|
|
339
|
+
currentModalCode = null;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function actAndClose(action, code) {
|
|
343
|
+
act(action, code);
|
|
344
|
+
document.getElementById('modal-overlay').classList.remove('open');
|
|
345
|
+
currentModalCode = null;
|
|
346
|
+
}
|
|
176
347
|
|
|
177
348
|
function render(req) {
|
|
178
|
-
|
|
349
|
+
requestData.set(req.code, req);
|
|
350
|
+
var el = document.createElement('div');
|
|
179
351
|
el.className = 'card';
|
|
180
352
|
el.id = 'card-' + req.code;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
<div class="
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
</div>
|
|
191
|
-
|
|
353
|
+
el.onclick = function(e) {
|
|
354
|
+
if (e.target.closest('.actions')) return;
|
|
355
|
+
openModal(req.code);
|
|
356
|
+
};
|
|
357
|
+
var args = JSON.stringify(req.args, null, 2);
|
|
358
|
+
el.innerHTML =
|
|
359
|
+
'<div class="tool">' + esc(req.tool) + '</div>' +
|
|
360
|
+
'<div class="agent">agent: ' + esc(req.agentId) + '</div>' +
|
|
361
|
+
'<div class="args">' + esc(args) + '</div>' +
|
|
362
|
+
'<div class="code">' + req.code + '</div>' +
|
|
363
|
+
'<div class="actions">' +
|
|
364
|
+
'<button class="btn btn-approve" onclick="act(\\x27approve\\x27,\\x27' + req.code + '\\x27)">Approve<kbd>A</kbd></button>' +
|
|
365
|
+
'<button class="btn btn-deny" onclick="act(\\x27deny\\x27,\\x27' + req.code + '\\x27)">Deny<kbd>D</kbd></button>' +
|
|
366
|
+
'</div>';
|
|
192
367
|
cards.set(req.code, el);
|
|
193
368
|
list.prepend(el);
|
|
194
369
|
empty.style.display = 'none';
|
|
@@ -196,28 +371,51 @@ function render(req) {
|
|
|
196
371
|
|
|
197
372
|
function act(action, code) {
|
|
198
373
|
fetch('/' + action + '?code=' + code, { method: 'POST' });
|
|
199
|
-
|
|
374
|
+
var el = cards.get(code);
|
|
200
375
|
if (el) {
|
|
201
376
|
el.querySelector('.actions').innerHTML = '<div class="status ' + action + (action === 'approve' ? 'd' : '') + '">' + action + 'd</div>';
|
|
202
377
|
el.classList.add(action === 'approve' ? 'approved' : 'denied');
|
|
203
378
|
}
|
|
204
379
|
}
|
|
205
380
|
|
|
206
|
-
function esc(s) {
|
|
381
|
+
function esc(s) { var d = document.createElement('div'); d.textContent = s; return d.innerHTML; }
|
|
207
382
|
|
|
208
383
|
// Only request notification permission if the user has notifications enabled
|
|
209
384
|
if ('Notification' in window && notifsEl.checked) Notification.requestPermission();
|
|
210
|
-
notifsEl.addEventListener('change', ()
|
|
385
|
+
notifsEl.addEventListener('change', function() {
|
|
211
386
|
if (notifsEl.checked && 'Notification' in window) Notification.requestPermission();
|
|
212
387
|
});
|
|
213
388
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
389
|
+
// Keyboard shortcuts: a=approve, d=deny, Escape=close modal
|
|
390
|
+
function getFirstPendingCode() {
|
|
391
|
+
for (var entry of cards) {
|
|
392
|
+
if (!entry[1].classList.contains('approved') && !entry[1].classList.contains('denied')) return entry[0];
|
|
393
|
+
}
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
document.addEventListener('keydown', function(e) {
|
|
398
|
+
if (e.key === 'Escape') { closeModal(); return; }
|
|
399
|
+
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
|
|
400
|
+
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
401
|
+
var key = e.key.toLowerCase();
|
|
402
|
+
if (key === 'a' || key === 'd') {
|
|
403
|
+
var action = key === 'a' ? 'approve' : 'deny';
|
|
404
|
+
var code = currentModalCode || getFirstPendingCode();
|
|
405
|
+
if (!code) return;
|
|
406
|
+
var el = cards.get(code);
|
|
407
|
+
if (el && (el.classList.contains('approved') || el.classList.contains('denied'))) return;
|
|
408
|
+
if (currentModalCode) { actAndClose(action, code); } else { act(action, code); }
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
var es = new EventSource('/events');
|
|
413
|
+
es.onmessage = function(e) {
|
|
414
|
+
var msg = JSON.parse(e.data);
|
|
217
415
|
if (msg.type === 'new') {
|
|
218
416
|
render(msg.request);
|
|
219
417
|
if (notifsEl.checked && Notification.permission === 'granted') {
|
|
220
|
-
|
|
418
|
+
new Notification('Airlock: ' + msg.request.tool, {
|
|
221
419
|
body: 'agent: ' + msg.request.agentId + '\\n' + msg.request.code,
|
|
222
420
|
tag: msg.request.code,
|
|
223
421
|
silent: !soundEl.checked,
|
|
@@ -225,14 +423,15 @@ es.onmessage = (e) => {
|
|
|
225
423
|
}
|
|
226
424
|
}
|
|
227
425
|
if (msg.type === 'resolved') {
|
|
228
|
-
|
|
426
|
+
var el = cards.get(msg.code);
|
|
229
427
|
if (el) {
|
|
230
428
|
el.querySelector('.actions').innerHTML = '<div class="status ' + (msg.action === 'approved' ? 'approved' : 'denied') + '">' + msg.action + '</div>';
|
|
231
429
|
el.classList.add(msg.action);
|
|
232
430
|
}
|
|
233
431
|
}
|
|
234
432
|
};
|
|
235
|
-
</
|
|
433
|
+
</scr` +
|
|
434
|
+
`ipt>
|
|
236
435
|
</body>
|
|
237
436
|
</html>`;
|
|
238
437
|
//# sourceMappingURL=dashboard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../../src/hitl/providers/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../../src/hitl/providers/dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,MAAM,GAAG,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAE1C,IAAI,kBAAkB,GAAkD,IAAI,CAAC;AAC7E,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,SAAS;AAM9C,MAAM,OAAO,qBAAqB;IAMtB;IACA;IANF,MAAM,CAAU;IAChB,OAAO,GAAG,IAAI,GAAG,EAAyD,CAAC;IAC3E,OAAO,GAAG,IAAI,GAAG,EAA4B,CAAC;IAEtD,YACU,MAA2B,EAC3B,WAAwB;QADxB,WAAM,GAAN,MAAM,CAAqB;QAC3B,gBAAW,GAAX,WAAW,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