推进 INI 面板 load-session workflow helper
This commit is contained in:
@@ -37,6 +37,35 @@ export function sessionSnapshotRestoreLogLines(summary) {
|
||||
];
|
||||
}
|
||||
|
||||
export function createMachineSessionLoadFieldState(summary) {
|
||||
return {
|
||||
sessionIni: summary.iniWasmPath,
|
||||
sessionParameters: summary.parameterWasmPath,
|
||||
sessionToolTable: summary.toolTableWasmPath,
|
||||
};
|
||||
}
|
||||
|
||||
export function machineSessionLoadWorkflowLogLines(summary) {
|
||||
return [
|
||||
"Loaded machine session into the interpreter WASM filesystem.",
|
||||
...machineSessionLoadLogLines(summary),
|
||||
];
|
||||
}
|
||||
|
||||
export async function loadMachineSessionIntoWasmWorkflow({ loadSession }) {
|
||||
if (typeof loadSession !== "function") {
|
||||
throw new Error("A machine session loader is required.");
|
||||
}
|
||||
const loadedSession = await loadSession();
|
||||
const loadSummary = createMachineSessionLoadSummary(loadedSession);
|
||||
return {
|
||||
loadedSession,
|
||||
loadSummary,
|
||||
fields: createMachineSessionLoadFieldState(loadSummary),
|
||||
logLines: machineSessionLoadWorkflowLogLines(loadSummary),
|
||||
};
|
||||
}
|
||||
|
||||
export async function saveMachineSessionSnapshotWorkflow({
|
||||
machineId,
|
||||
snapshotId,
|
||||
|
||||
Reference in New Issue
Block a user