Mount Cortex OS Runtime Health as WebUI panel

This commit is contained in:
Svrnty
2026-05-29 03:13:56 -04:00
parent 1707a7b09d
commit 3685710fe8
5 changed files with 54 additions and 4 deletions
@@ -9,6 +9,10 @@
font: 14px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
main.main:not(.svrnty-showing-cortex-os) .cortex-os-runtime-health {
display: none;
}
.cortex-os-runtime-health h2 {
margin: 0 0 8px;
font-size: 15px;
@@ -42,7 +42,10 @@
panel.appendChild(summary);
panel.appendChild(list);
var target = document.querySelector("main") || document.body;
var target = document.querySelector("main.main");
if (!target) {
return panel;
}
target.appendChild(panel);
return panel;
}
@@ -99,9 +102,17 @@
});
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", loadRuntimeHealth, { once: true });
} else {
function handlePanelSwitch(event) {
var detail = (event && event.detail) || {};
if (detail.name === "cortex-os") {
loadRuntimeHealth();
}
}
window.addEventListener("svrnty:panel-switch", handlePanelSwitch);
var main = document.querySelector("main.main");
if (main && main.classList.contains("svrnty-showing-cortex-os")) {
loadRuntimeHealth();
}
})();