feat: Refactor tenant configuration management to use KV API

- Updated tenant web search and agent configuration endpoints to utilize a KV-style API for better flexibility.
- Enhanced the tenant handler to support generic key-value operations for retrieving and updating configurations.
- Improved frontend API calls to align with the new KV API structure, ensuring consistent data handling.
- Removed deprecated direct configuration endpoints for a cleaner and more maintainable codebase.
This commit is contained in:
wizardchen
2025-11-10 20:11:45 +08:00
parent 07a8c1de4c
commit ac8c8e9af2
8 changed files with 201 additions and 178 deletions
+2 -2
View File
@@ -38,9 +38,9 @@ export function getSystemInfo(): Promise<{ data: SystemInfo }> {
}
export function getAgentConfig(): Promise<{ data: AgentConfig }> {
return get('/api/v1/tenants/agent-config')
return get('/api/v1/tenants/kv/agent-config')
}
export function updateAgentConfig(config: AgentConfig): Promise<{ data: AgentConfig }> {
return put('/api/v1/tenants/agent-config', config)
return put('/api/v1/tenants/kv/agent-config', config)
}
+4 -4
View File
@@ -29,13 +29,13 @@ export function getWebSearchProviders() {
return get('/api/v1/web-search/providers')
}
// Get tenant web search config
// Get tenant web search config via KV API
export function getTenantWebSearchConfig() {
return get('/api/v1/tenants/web-search-config')
return get('/api/v1/tenants/kv/web-search-config')
}
// Update tenant web search config
// Update tenant web search config via KV API
export function updateTenantWebSearchConfig(config: WebSearchConfig) {
return put('/api/v1/tenants/web-search-config', config)
return put('/api/v1/tenants/kv/web-search-config', config)
}