feat: add useApiSettings hook for managing API settings, including providers, endpoints, cache, and model pools

- Implemented hooks for CRUD operations on providers and endpoints.
- Added cache management hooks for cache stats and settings.
- Introduced model pool management hooks for high availability and load balancing.
- Created localization files for English and Chinese translations of API settings.
This commit is contained in:
catlog22
2026-02-01 23:14:55 +08:00
parent b76424feef
commit e5252f8a77
27 changed files with 4370 additions and 201 deletions

View File

@@ -112,3 +112,19 @@ export const workspaceQueryKeys = {
cliExecutionDetail: (projectPath: string, executionId: string) =>
[...workspaceQueryKeys.cliHistory(projectPath), 'detail', executionId] as const,
};
// ========== API Settings Keys ==========
/**
* API Settings query keys (global, not workspace-specific)
*/
export const apiSettingsKeys = {
all: ['apiSettings'] as const,
providers: () => [...apiSettingsKeys.all, 'providers'] as const,
provider: (id: string) => [...apiSettingsKeys.providers(), id] as const,
endpoints: () => [...apiSettingsKeys.all, 'endpoints'] as const,
endpoint: (id: string) => [...apiSettingsKeys.endpoints(), id] as const,
cache: () => [...apiSettingsKeys.all, 'cache'] as const,
modelPools: () => [...apiSettingsKeys.all, 'modelPools'] as const,
modelPool: (id: string) => [...apiSettingsKeys.modelPools(), id] as const,
ccwLitellm: () => [...apiSettingsKeys.all, 'ccwLitellm'] as const,
};