diff --git a/frontend/src/api/endpoints/providers.ts b/frontend/src/api/endpoints/providers.ts index d4ebfe9..4eeeb84 100644 --- a/frontend/src/api/endpoints/providers.ts +++ b/frontend/src/api/endpoints/providers.ts @@ -95,3 +95,50 @@ export async function testModel(data: TestModelRequest): Promise { + const response = await client.get(`/api/admin/providers/${providerId}/alias-mapping-preview`) + return response.data +} diff --git a/frontend/src/api/endpoints/types.ts b/frontend/src/api/endpoints/types.ts index c318766..a8d49e8 100644 --- a/frontend/src/api/endpoints/types.ts +++ b/frontend/src/api/endpoints/types.ts @@ -641,6 +641,7 @@ export interface RoutingKeyInfo { health_score: number is_active: boolean api_formats: string[] + allowed_models?: string[] | null // 允许的模型列表,null 表示不限制 circuit_breaker_open: boolean circuit_breaker_formats: string[] } diff --git a/frontend/src/features/models/components/ModelAliasesTab.vue b/frontend/src/features/models/components/ModelAliasesTab.vue new file mode 100644 index 0000000..88c4e0e --- /dev/null +++ b/frontend/src/features/models/components/ModelAliasesTab.vue @@ -0,0 +1,523 @@ + + + diff --git a/frontend/src/features/models/components/ModelDetailDrawer.vue b/frontend/src/features/models/components/ModelDetailDrawer.vue index 666e555..1e703ef 100644 --- a/frontend/src/features/models/components/ModelDetailDrawer.vue +++ b/frontend/src/features/models/components/ModelDetailDrawer.vue @@ -104,6 +104,19 @@ 链路 + @@ -419,6 +432,17 @@ @delete-provider="handleDeleteProviderFromRouting" /> + + +
+ +
@@ -456,6 +480,7 @@ import TableRow from '@/components/ui/table-row.vue' import TableHead from '@/components/ui/table-head.vue' import TableCell from '@/components/ui/table-cell.vue' import RoutingTab from './RoutingTab.vue' +import ModelAliasesTab from './ModelAliasesTab.vue' // 使用外部类型定义 import type { GlobalModelResponse } from '@/api/global-models' @@ -518,6 +543,13 @@ function refreshRoutingData() { routingTabRef.value?.loadRoutingData?.() } +// 处理模型别名更新 +function handleAliasesUpdate(_aliases: string[]) { + // 别名已在 ModelAliasesTab 内部保存到服务器 + // 刷新路由数据以反映可能的候选变化 + refreshRoutingData() +} + // 暴露刷新方法给父组件 defineExpose({ refreshRoutingData diff --git a/frontend/src/features/models/components/RoutingTab.vue b/frontend/src/features/models/components/RoutingTab.vue index ce948f4..00e82bf 100644 --- a/frontend/src/features/models/components/RoutingTab.vue +++ b/frontend/src/features/models/components/RoutingTab.vue @@ -76,21 +76,19 @@ >
-
+
{{ formatGroup.api_format }} - + {{ formatGroup.active_keys }}/{{ formatGroup.total_keys }} Keys - - · - + · {{ formatGroup.active_providers }}/{{ formatGroup.total_providers }} 提供商
@@ -105,203 +103,220 @@
@@ -485,7 +574,6 @@