推进 INI 面板 launch API manifest

This commit is contained in:
2026-06-15 06:25:47 +08:00
parent 6ba8e43850
commit 7d906f1809
8 changed files with 150 additions and 1 deletions

View File

@@ -90,6 +90,7 @@
}
window.linuxCncIniPanelLaunchApi = {
getLaunchApiManifest: () => shellViewModel.launchApiManifest,
getLauncherLinks: () => shellViewModel.launcherLinks,
getControlPageApiMethods: () => shellViewModel.controlPage.browserApiMethods,
};

View File

@@ -61,6 +61,27 @@ export function createIniPanelLauncherLinkViewModel(entries = getVisibleIniPanel
}));
}
export function createIniPanelLaunchApiManifest(entries = getVisibleIniPanelEntries()) {
return {
apiName: "ini-panel-launch",
methods: [
"getLaunchApiManifest",
"getLauncherLinks",
"getControlPageApiMethods",
],
visibleEntries: entries.map(({ id, href, title }) => ({
id,
href,
title,
})),
targetPages: entries.map(({ id, href }) => ({
entryId: id,
href,
})),
controlPageApiMethods: createControlPageBrowserApiMethods(),
};
}
export function createIniPanelShellControlPageContract() {
const readonlyStatusApiManifest = createMachineSessionReadonlyStatusApiManifest();
return {
@@ -99,6 +120,7 @@ export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries
title,
})),
launcherLinks: createIniPanelLauncherLinkViewModel(entries),
launchApiManifest: createIniPanelLaunchApiManifest(entries),
controlPage: {
browserApiMethods: createControlPageBrowserApiMethods(),
contract: createIniPanelShellControlPageContract(),