推进 INI 面板状态 bundle helper
This commit is contained in:
@@ -47,6 +47,7 @@ import {
|
||||
} from "./session-workflow.js";
|
||||
import {
|
||||
createMachineSessionStateSnapshot,
|
||||
createMachineSessionStateBundle,
|
||||
createMachineSessionStateReport,
|
||||
createMachineSessionStateReportExport,
|
||||
createMachineSessionWorkflowStatus,
|
||||
@@ -166,6 +167,10 @@ function getMachineSessionWorkflowStatus() {
|
||||
return createMachineSessionWorkflowStatus(window.linuxCncIniPanelMachineSessionState);
|
||||
}
|
||||
|
||||
function getMachineSessionStateBundle() {
|
||||
return createMachineSessionStateBundle(window.linuxCncIniPanelMachineSessionState);
|
||||
}
|
||||
|
||||
function updatePanelMachineSessionState(patch = {}) {
|
||||
panelMachineSessionState = createMachineSessionStateSnapshot({
|
||||
...panelMachineSessionState,
|
||||
@@ -180,10 +185,12 @@ function updatePanelMachineSessionState(patch = {}) {
|
||||
}
|
||||
|
||||
window.linuxCncIniPanelApi = {
|
||||
getMachineSessionStateBundle,
|
||||
getMachineSessionStateReport,
|
||||
getMachineSessionStateReportExport,
|
||||
getMachineSessionWorkflowStatus,
|
||||
};
|
||||
window.getMachineSessionStateBundle = getMachineSessionStateBundle;
|
||||
window.getMachineSessionStateReport = getMachineSessionStateReport;
|
||||
window.getMachineSessionStateReportExport = getMachineSessionStateReportExport;
|
||||
window.getMachineSessionWorkflowStatus = getMachineSessionWorkflowStatus;
|
||||
|
||||
@@ -129,3 +129,14 @@ export function createMachineSessionWorkflowStatus(state = {}) {
|
||||
run: report.run,
|
||||
};
|
||||
}
|
||||
|
||||
export function createMachineSessionStateBundle(state = {}, options = {}) {
|
||||
const report = createMachineSessionStateReport(state);
|
||||
const exportPayload = createMachineSessionStateReportExport(state, options);
|
||||
const workflowStatus = createMachineSessionWorkflowStatus(state);
|
||||
return {
|
||||
report,
|
||||
export: exportPayload,
|
||||
workflowStatus,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user