推进 INI 面板 control view helper
This commit is contained in:
@@ -140,3 +140,48 @@ export function createMachineSessionStateBundle(state = {}, options = {}) {
|
||||
workflowStatus,
|
||||
};
|
||||
}
|
||||
|
||||
export function createMachineSessionControlView(bundle = {}) {
|
||||
const report = bundle.report ?? {};
|
||||
const workflowStatus = bundle.workflowStatus ?? {};
|
||||
const session = workflowStatus.session ?? report.session ?? {};
|
||||
const run = workflowStatus.run ?? report.run ?? {};
|
||||
return {
|
||||
status: {
|
||||
lastAction: workflowStatus.lastAction ?? report.status?.lastAction ?? null,
|
||||
error: workflowStatus.error ?? report.status?.error ?? null,
|
||||
runStatus: run.status ?? null,
|
||||
},
|
||||
sections: [
|
||||
{
|
||||
id: "readiness",
|
||||
title: "Readiness",
|
||||
rows: [
|
||||
{ label: "INI", value: workflowStatus.readiness?.ini ?? report.readiness?.ini ?? null },
|
||||
{ label: "Interpreter", value: workflowStatus.readiness?.interp ?? report.readiness?.interp ?? null },
|
||||
{ label: "OPFS", value: workflowStatus.readiness?.opfs ?? report.readiness?.opfs ?? null },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "session",
|
||||
title: "Session",
|
||||
rows: [
|
||||
{ label: "Snapshot", value: session.snapshotLabel ?? null },
|
||||
{ label: "Workflow", value: session.workflow ?? null },
|
||||
{ label: "INI", value: session.ini ?? null },
|
||||
{ label: "G-code", value: session.gcode ?? null },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: "run",
|
||||
title: "Run",
|
||||
rows: [
|
||||
{ label: "Status", value: run.status ?? null },
|
||||
{ label: "Canonical events", value: run.canonicalEventCount ?? 0 },
|
||||
{ label: "Motion snapshots", value: run.motionSnapshotCount ?? 0 },
|
||||
{ label: "INI WASM", value: run.iniWasmPath ?? null },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user