Merge pull request #681 from zhefox/main

Codex 重置功能和显示缓存修复以及批量key的导入和管理功能
This commit is contained in:
ZheFox
2026-07-16 19:48:33 +08:00
committed by GitHub
19 changed files with 2216 additions and 131 deletions
+42
View File
@@ -337,9 +337,39 @@ export interface PoolBatchAction {
| 'delete'
| 'clear_proxy'
| 'set_proxy'
| 'update_settings'
payload?: Record<string, unknown> | null
}
export interface PoolKeySettingsPatch {
internal_priority?: number
rpm_limit?: number | null
concurrent_limit?: number | null
cache_ttl_minutes?: number
max_probe_interval_minutes?: number
is_active?: boolean
note?: string | null
proxy_node_id?: string | null
}
export interface PoolBatchImportRequest {
keys: Array<{
name: string
api_key: string
auth_type: 'api_key' | 'bearer'
api_formats?: string[]
settings?: PoolKeySettingsPatch
}>
api_formats?: string[]
settings?: PoolKeySettingsPatch
}
export interface PoolBatchImportResult {
imported: number
skipped: number
errors: Array<{ index: number; reason: string }>
}
interface PoolReadOptions {
cacheTtlMs?: number
}
@@ -442,6 +472,18 @@ export async function batchActionPoolKeys(
return response.data
}
export async function batchImportPoolKeys(
providerId: string,
body: PoolBatchImportRequest,
): Promise<PoolBatchImportResult> {
const response = await client.post<PoolBatchImportResult>(
`/api/admin/pool/${providerId}/keys/batch-import`,
body,
{ timeout: POOL_BATCH_ACTION_TIMEOUT_MS },
)
return response.data
}
export interface BatchDeleteTaskStatus {
task_id: string
status: 'pending' | 'running' | 'completed' | 'failed'