@feigi/fleet-ctl 3.45.0 → 3.45.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/package.json +1 -1
- package/scripts/board.html +18 -18
package/package.json
CHANGED
package/scripts/board.html
CHANGED
|
@@ -360,26 +360,19 @@ function render(m) {
|
|
|
360
360
|
// only says it may be short at one edge. The footer append above is what
|
|
361
361
|
// actually guarantees this notice reaches the operator on a tick where a
|
|
362
362
|
// higher-priority arm wins the slot instead.
|
|
363
|
-
//
|
|
364
|
-
// element is reused across ticks, so a `dead` class
|
|
365
|
-
//
|
|
366
|
-
//
|
|
363
|
+
// Every banner writer goes through showBanner, which assigns the class as
|
|
364
|
+
// well as the text: this element is reused across ticks, so a `dead` class
|
|
365
|
+
// left behind by an earlier write would paint the next message red. Routing
|
|
366
|
+
// every writer through the one setter, rather than one assignment per arm,
|
|
367
|
+
// is what makes that unreachable rather than unlikely.
|
|
367
368
|
if (built && Date.now() - m.generatedAt > interval * 1000 * 2) {
|
|
368
|
-
|
|
369
|
-
banner.className = "";
|
|
370
|
-
banner.textContent = "⚠ data stale — server/controller stopped?";
|
|
369
|
+
showBanner("⚠ data stale — server/controller stopped?");
|
|
371
370
|
} else if (stallMsg) {
|
|
372
|
-
|
|
373
|
-
banner.className = "dead";
|
|
374
|
-
banner.textContent = stallMsg;
|
|
371
|
+
showBanner(stallMsg, "dead");
|
|
375
372
|
} else if (ledgerMsg) {
|
|
376
|
-
|
|
377
|
-
banner.className = "";
|
|
378
|
-
banner.textContent = ledgerMsg;
|
|
373
|
+
showBanner(ledgerMsg);
|
|
379
374
|
} else if (capMsg) {
|
|
380
|
-
|
|
381
|
-
banner.className = "";
|
|
382
|
-
banner.textContent = capMsg;
|
|
375
|
+
showBanner(capMsg);
|
|
383
376
|
} else { banner.style.display = "none"; banner.className = ""; }
|
|
384
377
|
}
|
|
385
378
|
|
|
@@ -448,10 +441,17 @@ function card(t) {
|
|
|
448
441
|
return c;
|
|
449
442
|
}
|
|
450
443
|
|
|
451
|
-
|
|
444
|
+
// The one writer of a shown banner: display, class and text move together, so
|
|
445
|
+
// no caller can show a message while a previous caller's class is still set.
|
|
446
|
+
function showBanner(text, cls = "") {
|
|
452
447
|
const banner = document.getElementById("stale-banner");
|
|
453
448
|
banner.style.display = "block";
|
|
454
|
-
banner.
|
|
449
|
+
banner.className = cls;
|
|
450
|
+
banner.textContent = text;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
function warn(msg) {
|
|
454
|
+
showBanner(msg);
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
async function poll() {
|