接入 INI 面板浏览器状态 report getter

This commit is contained in:
2026-06-14 22:10:57 +08:00
parent 5b45491e55
commit 404cb1344c
4 changed files with 147 additions and 13 deletions

View File

@@ -47,6 +47,7 @@ import {
} from "./session-workflow.js";
import {
createMachineSessionStateSnapshot,
createMachineSessionStateReport,
} from "./panel-state-summary.js";
const SAMPLE_PATH =
@@ -151,6 +152,10 @@ let canonicalEventText = "";
let runPlaybackTimer = null;
let panelMachineSessionState = createMachineSessionStateSnapshot();
function getMachineSessionStateReport() {
return createMachineSessionStateReport(window.linuxCncIniPanelMachineSessionState);
}
function updatePanelMachineSessionState(patch = {}) {
panelMachineSessionState = createMachineSessionStateSnapshot({
...panelMachineSessionState,
@@ -164,6 +169,9 @@ function updatePanelMachineSessionState(patch = {}) {
return panelMachineSessionState;
}
window.getMachineSessionStateReport = getMachineSessionStateReport;
window.linuxCncIniPanelMachineSessionState = panelMachineSessionState;
function setBadge(node, text, className = "badge") {
node.className = className;
node.textContent = text;