feat: Provider 摘要 API 改为服务端分页,支持搜索和筛选

- 后端 /summary 接口新增 page/page_size/search/status/api_format/model_id 参数
- 新增 ProviderSummaryPageResponse 分页响应模型
- 前端 useProviderFilters 从客户端筛选改为构建服务端查询参数
- ProviderManagement 通过 watch queryParams 实现分页/筛选联动,搜索 debounce 300ms
- PriorityManagementDialog 改为对话框打开时自行加载全量 providers
- 其他使用方(StandaloneKeyFormDialog/UserFormDialog/ReplayDialog/ModelManagement)适配新接口
This commit is contained in:
fawney19
2026-03-09 12:45:54 +08:00
parent 40736a8334
commit 0046123e22
10 changed files with 182 additions and 151 deletions

View File

@@ -9,13 +9,32 @@ import type {
} from './types'
/**
* 获取 Providers 摘要(包含 Endpoints 统计
* 获取 Providers 摘要(分页
*/
export async function getProvidersSummary(): Promise<ProviderWithEndpointsSummary[]> {
return dedupedRequest('providers:summary', async () => {
const response = await client.get<ProviderWithEndpointsSummary[]>('/api/admin/providers/summary')
return response.data
})
export interface ProviderSummaryQuery {
page?: number
page_size?: number
search?: string
status?: string
api_format?: string
model_id?: string
}
export interface ProviderSummaryPageResponse {
total: number
page: number
page_size: number
items: ProviderWithEndpointsSummary[]
}
export async function getProvidersSummary(
params: ProviderSummaryQuery = {},
): Promise<ProviderSummaryPageResponse> {
const response = await client.get<ProviderSummaryPageResponse>(
'/api/admin/providers/summary',
{ params },
)
return response.data
}
/**