diff --git a/frontend/src/api/client.js b/frontend/src/api/client.js
index 8f771a5..77201f9 100644
--- a/frontend/src/api/client.js
+++ b/frontend/src/api/client.js
@@ -34,21 +34,26 @@ async function request(path, options = {}) {
if (!res.ok) {
let msg = `HTTP ${res.status}`
- try { msg = (await res.json()).detail || msg } catch {}
- throw new Error(msg)
+ let payload = null
+ try {
+ const body = await res.json()
+ if (typeof body.detail === 'object' && body.detail !== null) {
+ payload = body.detail
+ msg = body.detail.message || `HTTP ${res.status}`
+ } else {
+ msg = body.detail || msg
+ }
+ } catch {}
+ const err = new Error(msg)
+ err.status = res.status
+ if (payload) err.payload = payload
+ throw err
}
return res.json()
}
// ── Documents ────────────────────────────────────────────────────────────────
-export function uploadDocument(file, autoClassify = true) {
- const form = new FormData()
- form.append('file', file)
- form.append('auto_classify', autoClassify ? 'true' : 'false')
- return request('/api/documents/upload', { method: 'POST', body: form })
-}
-
export function listDocuments({ topic, page = 1, perPage = 20 } = {}) {
const params = new URLSearchParams({ page, per_page: perPage })
if (topic) params.set('topic', topic)
diff --git a/frontend/src/components/upload/UploadProgress.vue b/frontend/src/components/upload/UploadProgress.vue
index 908cf70..0847af8 100644
--- a/frontend/src/components/upload/UploadProgress.vue
+++ b/frontend/src/components/upload/UploadProgress.vue
@@ -7,14 +7,64 @@
>
{{ item.name }}
-
{{ item.error }}
-
+
+
+
{{ item.error }}
+
+
+
Done{{ item.topics?.length ? ` — classified as: ${item.topics.join(', ')}` : ' — no topics assigned' }}
-
Uploading…
+
+
+
+
Not enough storage
+
+ This file ({{ (item.quotaError.rejected_bytes / 1048576).toFixed(1) }} MB) would exceed your quota.
+
+
+ You're using {{ (item.quotaError.used_bytes / 1048576).toFixed(1) }} MB of {{ (item.quotaError.limit_bytes / 1048576).toFixed(1) }} MB.
+
+
+
+ Manage storage →
+
+
+
+
+
+
+
+
+ {{ item.progress }}%
+
+ {{ item.status || 'Uploading…' }}
+
+
+
-