From 349912cac3ff1a43b278caa9e39c439e2c0d9fdb Mon Sep 17 00:00:00 2001 From: curo1305 Date: Sat, 23 May 2026 20:34:15 +0200 Subject: [PATCH] feat(03-04): replace settings UI with admin-managed placeholder; update API client MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - views/SettingsView.vue: Replace full form with static placeholder card. No store imports, no API calls. Shows "AI configuration is managed by your administrator." (D-12, T-03-21) - stores/settings.js: Deleted — only consumed by SettingsView; no other imports - api/client.js: Remove getSettings, patchSettings, testProvider, getDefaultPrompt (// Settings section deleted). Add getMyQuota() for quota bar (Plan 03-05). Add getUploadUrl() and confirmUpload() for presigned upload flow (Plan 03-05). --- frontend/src/api/client.js | 38 ++--- frontend/src/stores/settings.js | 38 ----- frontend/src/views/SettingsView.vue | 226 ++-------------------------- 3 files changed, 26 insertions(+), 276 deletions(-) delete mode 100644 frontend/src/stores/settings.js diff --git a/frontend/src/api/client.js b/frontend/src/api/client.js index 6855396..8f771a5 100644 --- a/frontend/src/api/client.js +++ b/frontend/src/api/client.js @@ -71,6 +71,18 @@ export function classifyDocument(id, topics = null) { }) } +export function getUploadUrl(filename, contentType) { + return request('/api/documents/upload-url', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ filename, content_type: contentType }), + }) +} + +export function confirmUpload(documentId) { + return request(`/api/documents/${documentId}/confirm`, { method: 'POST' }) +} + // ── Topics ─────────────────────────────────────────────────────────────────── export function listTopics() { @@ -105,30 +117,10 @@ export function suggestTopics(documentId) { }) } -// ── Settings ───────────────────────────────────────────────────────────────── +// ── Quota ──────────────────────────────────────────────────────────────────── -export function getSettings() { - return request('/api/settings') -} - -export function patchSettings(patch) { - return request('/api/settings', { - method: 'PATCH', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(patch), - }) -} - -export function testProvider(provider) { - return request('/api/settings/test-provider', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ provider }), - }) -} - -export function getDefaultPrompt() { - return request('/api/settings/default-prompt') +export function getMyQuota() { + return request('/api/auth/me/quota') } // ── Auth ───────────────────────────────────────────────────────────────────── diff --git a/frontend/src/stores/settings.js b/frontend/src/stores/settings.js deleted file mode 100644 index fc5709c..0000000 --- a/frontend/src/stores/settings.js +++ /dev/null @@ -1,38 +0,0 @@ -import { defineStore } from 'pinia' -import { ref } from 'vue' -import * as api from '../api/client.js' - -export const useSettingsStore = defineStore('settings', () => { - const settings = ref(null) - const loading = ref(false) - const error = ref(null) - - async function fetchSettings() { - loading.value = true - error.value = null - try { - settings.value = await api.getSettings() - } catch (e) { - error.value = e.message - } finally { - loading.value = false - } - } - - async function save(patch) { - const updated = await api.patchSettings(patch) - settings.value = updated - return updated - } - - async function testConnection(provider) { - return api.testProvider(provider) - } - - async function resetPrompt() { - const data = await api.getDefaultPrompt() - return data.system_prompt - } - - return { settings, loading, error, fetchSettings, save, testConnection, resetPrompt } -}) diff --git a/frontend/src/views/SettingsView.vue b/frontend/src/views/SettingsView.vue index 0f943f2..6cc35e4 100644 --- a/frontend/src/views/SettingsView.vue +++ b/frontend/src/views/SettingsView.vue @@ -1,223 +1,19 @@