推进 INI 面板 shell view-model helper

This commit is contained in:
2026-06-15 04:30:56 +08:00
parent b330f7b1bc
commit 213514f64c
5 changed files with 116 additions and 0 deletions

View File

@@ -3,6 +3,12 @@ import {
getIniPanelEntryByHref,
getIniPanelEntryManifest,
} from "./entry-manifest.js";
import {
createMachineSessionControlPageController,
} from "./control-page-controller.js";
import {
renderMachineSessionControlView,
} from "./control-view-renderer.js";
export {
INI_PANEL_ENTRIES,
getIniPanelEntryByHref,
@@ -26,3 +32,18 @@ export function createIniPanelLauncherLinkViewModel(entries = getVisibleIniPanel
label: title,
}));
}
export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) {
return {
pages: entries.map(({ id, href, title }) => ({
id,
href,
title,
})),
launcherLinks: createIniPanelLauncherLinkViewModel(entries),
controlPage: {
createController: createMachineSessionControlPageController,
renderView: renderMachineSessionControlView,
},
};
}