mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-13 06:30:20 +08:00
feat(pool): add bulk key configuration management
This commit is contained in:
@@ -1073,6 +1073,14 @@ export const adminApi = {
|
||||
return response.data
|
||||
},
|
||||
|
||||
async queryProviderModelsForKeys(providerId: string, apiKeyIds: string[], forceRefresh = false): Promise<ProviderModelsQueryResponse> {
|
||||
const response = await apiClient.post<ProviderModelsQueryResponse>(
|
||||
'/api/admin/provider-query/models',
|
||||
{ provider_id: providerId, api_key_ids: apiKeyIds, force_refresh: forceRefresh }
|
||||
)
|
||||
return response.data
|
||||
},
|
||||
|
||||
// 测试 SMTP 连接,支持传入未保存的配置
|
||||
async testSmtpConnection(config: Record<string, unknown> = {}): Promise<{ success: boolean; message: string }> {
|
||||
const response = await apiClient.post<{ success: boolean; message: string }>(
|
||||
|
||||
@@ -340,6 +340,48 @@ export interface PoolBatchAction {
|
||||
payload?: Record<string, unknown> | null
|
||||
}
|
||||
|
||||
export interface PoolKeyBatchUpdatePatch {
|
||||
api_formats?: string[]
|
||||
auth_type_by_format?: Record<string, 'api_key' | 'bearer'> | null
|
||||
allow_auth_channel_mismatch_formats?: string[] | null
|
||||
rate_multipliers?: Record<string, number> | null
|
||||
internal_priority?: number
|
||||
global_priority_by_format?: Record<string, number> | null
|
||||
rpm_limit?: number | null
|
||||
concurrent_limit?: number | null
|
||||
allowed_models?: AllowedModels
|
||||
capabilities?: Record<string, boolean> | null
|
||||
cache_ttl_minutes?: number
|
||||
max_probe_interval_minutes?: number
|
||||
is_active?: boolean
|
||||
note?: string | null
|
||||
auto_fetch_models?: boolean
|
||||
locked_models?: string[]
|
||||
model_include_patterns?: string[]
|
||||
model_exclude_patterns?: string[]
|
||||
proxy?: ProxyConfig | null
|
||||
}
|
||||
|
||||
export interface PoolKeyBatchUpdateRequest {
|
||||
key_ids: string[]
|
||||
patch: PoolKeyBatchUpdatePatch
|
||||
}
|
||||
|
||||
export interface PoolKeyBatchModelSyncResult {
|
||||
requested: number
|
||||
attempted: number
|
||||
succeeded: number
|
||||
failed: number
|
||||
skipped: number
|
||||
error?: string
|
||||
}
|
||||
|
||||
export interface PoolKeyBatchUpdateResponse {
|
||||
affected: number
|
||||
message: string
|
||||
model_sync: PoolKeyBatchModelSyncResult | null
|
||||
}
|
||||
|
||||
interface PoolReadOptions {
|
||||
cacheTtlMs?: number
|
||||
}
|
||||
@@ -442,6 +484,18 @@ export async function batchActionPoolKeys(
|
||||
return response.data
|
||||
}
|
||||
|
||||
export async function batchUpdatePoolKeys(
|
||||
providerId: string,
|
||||
body: PoolKeyBatchUpdateRequest,
|
||||
): Promise<PoolKeyBatchUpdateResponse> {
|
||||
const response = await client.patch<PoolKeyBatchUpdateResponse>(
|
||||
`/api/admin/pool/${providerId}/keys/batch-update`,
|
||||
body,
|
||||
{ timeout: POOL_BATCH_ACTION_TIMEOUT_MS },
|
||||
)
|
||||
return response.data
|
||||
}
|
||||
|
||||
export interface BatchDeleteTaskStatus {
|
||||
task_id: string
|
||||
status: 'pending' | 'running' | 'completed' | 'failed'
|
||||
|
||||
Reference in New Issue
Block a user