推进 INI 面板 session summary helper
This commit is contained in:
28
wasm-port/runtime/ui/ini-panel/session-summary.js
Normal file
28
wasm-port/runtime/ui/ini-panel/session-summary.js
Normal file
@@ -0,0 +1,28 @@
|
||||
export function createSessionSnapshotSummary(snapshot, fallbackLabel = null) {
|
||||
const metadata = snapshot?.metadata ?? {};
|
||||
const files = snapshot?.payload?.files ?? {};
|
||||
return {
|
||||
snapshotLabel: fallbackLabel ?? metadata.snapshotLabel ?? null,
|
||||
workflow: metadata.workflow ?? null,
|
||||
defaultGcodeOpfsPath: metadata.defaultGcodeOpfsPath ?? null,
|
||||
iniOpfsPath: files.ini ?? null,
|
||||
parameterOpfsPath: files.parameters ?? null,
|
||||
toolTableOpfsPath: files.toolTable ?? null,
|
||||
gcodeOpfsPath: files.gcode ?? null,
|
||||
};
|
||||
}
|
||||
|
||||
export function sessionSnapshotSummaryLogLines(summary) {
|
||||
return [
|
||||
`Snapshot: ${summary.snapshotLabel ?? "-"}`,
|
||||
`Workflow: ${summary.workflow ?? "-"}`,
|
||||
`Default G-code: ${summary.defaultGcodeOpfsPath ?? "-"}`,
|
||||
];
|
||||
}
|
||||
|
||||
export function sessionSnapshotMetadataLogLines(summary) {
|
||||
return [
|
||||
`Workflow: ${summary.workflow ?? "-"}`,
|
||||
`Default G-code: ${summary.defaultGcodeOpfsPath ?? "-"}`,
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user