接入 INI 面板只读 session readiness handoff
This commit is contained in:
@@ -5,6 +5,7 @@ export function createControlPageSessionLoadState({
|
||||
controlViewReady = false,
|
||||
stateBundle = null,
|
||||
workflowStatus = null,
|
||||
sessionReadiness = null,
|
||||
controlView = null,
|
||||
error = null,
|
||||
} = {}) {
|
||||
@@ -15,11 +16,19 @@ export function createControlPageSessionLoadState({
|
||||
controlViewReady,
|
||||
stateBundle,
|
||||
workflowStatus,
|
||||
sessionReadiness,
|
||||
controlView,
|
||||
error,
|
||||
};
|
||||
}
|
||||
|
||||
function getSessionReadiness(stateBundle, workflowStatus) {
|
||||
return workflowStatus?.sessionReadiness
|
||||
?? stateBundle?.workflowStatus?.sessionReadiness
|
||||
?? stateBundle?.report?.sessionReadiness
|
||||
?? null;
|
||||
}
|
||||
|
||||
export function loadMachineSessionForControlPageWorkflow({
|
||||
getPanelWindow,
|
||||
getPanelApi,
|
||||
@@ -63,22 +72,28 @@ export function loadMachineSessionForControlPageWorkflow({
|
||||
}
|
||||
|
||||
if (!controlView) {
|
||||
const stateBundle = panelApi.getMachineSessionStateBundle?.() ?? null;
|
||||
const workflowStatus = panelApi.getMachineSessionWorkflowStatus?.() ?? null;
|
||||
return createControlPageSessionLoadState({
|
||||
phase: "waiting-session",
|
||||
panelReady: true,
|
||||
apiReady: true,
|
||||
stateBundle: panelApi.getMachineSessionStateBundle?.() ?? null,
|
||||
workflowStatus: panelApi.getMachineSessionWorkflowStatus?.() ?? null,
|
||||
stateBundle,
|
||||
workflowStatus,
|
||||
sessionReadiness: getSessionReadiness(stateBundle, workflowStatus),
|
||||
});
|
||||
}
|
||||
|
||||
const stateBundle = panelApi.getMachineSessionStateBundle?.() ?? null;
|
||||
const workflowStatus = panelApi.getMachineSessionWorkflowStatus?.() ?? null;
|
||||
return createControlPageSessionLoadState({
|
||||
phase: "ready",
|
||||
panelReady: true,
|
||||
apiReady: true,
|
||||
controlViewReady: true,
|
||||
stateBundle: panelApi.getMachineSessionStateBundle?.() ?? null,
|
||||
workflowStatus: panelApi.getMachineSessionWorkflowStatus?.() ?? null,
|
||||
stateBundle,
|
||||
workflowStatus,
|
||||
sessionReadiness: getSessionReadiness(stateBundle, workflowStatus),
|
||||
controlView,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user