feat(07-05): frontend AI config client helpers + AdminAiConfigTab system section + Vitest tests
- Add getAiConfig/saveAiConfig/testAiConnection to frontend/src/api/client.js - AdminAiConfigTab.vue: add System AI Providers section above existing per-user table - Per-provider accordion (10 providers from PROVIDER_DEFAULTS) - Write-only API key field (never pre-filled), base URL, model, context_chars inputs - Set Active (atomic flip), Save, Test Connection buttons with inline badges - Existing per-user ai-config table and saveConfig logic untouched (Pitfall 6) - Create frontend/tests/api.spec.js: 4 Vitest tests for getAiConfig/saveAiConfig/testAiConnection - All 127 frontend tests pass, build exits 0 (D-11 frontend coverage)
This commit is contained in:
@@ -290,6 +290,27 @@ export function adminDeleteUser(id, adminPassword) {
|
||||
})
|
||||
}
|
||||
|
||||
// ── System AI Provider Configuration (D-08, D-15) ───────────────────────────
|
||||
|
||||
export function getAiConfig() {
|
||||
return request('/api/admin/ai-config', { method: 'GET' })
|
||||
}
|
||||
|
||||
export function saveAiConfig(body) {
|
||||
return request('/api/admin/ai-config', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(body),
|
||||
})
|
||||
}
|
||||
|
||||
export function testAiConnection(providerId) {
|
||||
return request(
|
||||
'/api/admin/ai-config/test-connection?provider_id=' + encodeURIComponent(providerId),
|
||||
{ method: 'GET' }
|
||||
)
|
||||
}
|
||||
|
||||
// ── Folders ───────────────────────────────────────────────────────────────────
|
||||
|
||||
export function listFolders(parentId = null) {
|
||||
|
||||
Reference in New Issue
Block a user