61 lines
1.6 KiB
JavaScript
61 lines
1.6 KiB
JavaScript
import {
|
|
INI_PANEL_ENTRIES,
|
|
getIniPanelEntryByHref,
|
|
getIniPanelEntryManifest,
|
|
} from "./entry-manifest.js";
|
|
import {
|
|
createMachineSessionControlPageController,
|
|
} from "./control-page-controller.js";
|
|
import {
|
|
renderMachineSessionControlView,
|
|
} from "./control-view-renderer.js";
|
|
import {
|
|
controlPageStatusText,
|
|
createControlPageRefreshState,
|
|
refreshMachineSessionControlPage,
|
|
} from "./control-page-refresh-workflow.js";
|
|
export {
|
|
controlPageStatusText,
|
|
createControlPageRefreshState,
|
|
refreshMachineSessionControlPage,
|
|
} from "./control-page-refresh-workflow.js";
|
|
export {
|
|
INI_PANEL_ENTRIES,
|
|
getIniPanelEntryByHref,
|
|
getIniPanelEntryManifest,
|
|
} from "./entry-manifest.js";
|
|
export {
|
|
createMachineSessionControlPageController,
|
|
} from "./control-page-controller.js";
|
|
export {
|
|
renderMachineSessionControlView,
|
|
} from "./control-view-renderer.js";
|
|
|
|
export function getVisibleIniPanelEntries() {
|
|
return getIniPanelEntryManifest();
|
|
}
|
|
|
|
export function createIniPanelLauncherLinkViewModel(entries = getVisibleIniPanelEntries()) {
|
|
return entries.map(({ id, href, title }) => ({
|
|
entryId: id,
|
|
href,
|
|
label: title,
|
|
}));
|
|
}
|
|
|
|
export function createIniPanelShellViewModel(entries = getVisibleIniPanelEntries()) {
|
|
return {
|
|
pages: entries.map(({ id, href, title }) => ({
|
|
id,
|
|
href,
|
|
title,
|
|
})),
|
|
launcherLinks: createIniPanelLauncherLinkViewModel(entries),
|
|
controlPage: {
|
|
createController: createMachineSessionControlPageController,
|
|
refresh: refreshMachineSessionControlPage,
|
|
renderView: renderMachineSessionControlView,
|
|
},
|
|
};
|
|
}
|