fix: show published models and support multi-model key selection

This commit is contained in:
wlx committed 2026-09-22 03:09:07 +08:00
1 parent 1a57de5bf9
commit 0a44a0802b
14 files changed
+360 -60

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import type { CatalogModel, LogicalModel } from './catalog'
// Browse published definitions even when none of their routes are enabled yet.
// Route IDs remain the exact authorization and invocation identifiers.
export function buildModelCatalog(definitions: LogicalModel[], routes: CatalogModel[]) {
return definitions.filter(model => model.status === 'active').map(definition => ({
definition,
groups: routes.filter(route => route.logicalModelId === definition.id && route.status === 'active'),
}))
}
export function setGroupSelection(selected: string[], groupIds: string[], checked: boolean): string[] {
return checked ? [...new Set([...selected, ...groupIds])] : selected.filter(id => !groupIds.includes(id))
}