diff --git a/mateclaw-ui/src/api/index.ts b/mateclaw-ui/src/api/index.ts
index fec88161..25435e40 100644
--- a/mateclaw-ui/src/api/index.ts
+++ b/mateclaw-ui/src/api/index.ts
@@ -422,9 +422,12 @@ export const wikiApi = {
listRaw: (kbId: number) => http.get(`/wiki/knowledge-bases/${kbId}/raw`),
addRawText: (kbId: number, data: { title: string; content: string }) =>
http.post(`/wiki/knowledge-bases/${kbId}/raw/text`, data),
- uploadRaw: (kbId: number, formData: FormData) =>
+ uploadRaw: (kbId: number, formData: FormData, onProgress?: (pct: number) => void) =>
http.post(`/wiki/knowledge-bases/${kbId}/raw/upload`, formData, {
headers: { 'Content-Type': 'multipart/form-data' },
+ onUploadProgress: onProgress
+ ? (e) => { if (e.total) onProgress(Math.round((e.loaded / e.total) * 100)) }
+ : undefined,
}),
deleteRaw: (kbId: number, rawId: number) =>
http.delete(`/wiki/knowledge-bases/${kbId}/raw/${rawId}`),
diff --git a/mateclaw-ui/src/i18n/locales/en-US.ts b/mateclaw-ui/src/i18n/locales/en-US.ts
index 18f8c8b3..a11e20ee 100644
--- a/mateclaw-ui/src/i18n/locales/en-US.ts
+++ b/mateclaw-ui/src/i18n/locales/en-US.ts
@@ -1222,6 +1222,9 @@ export default {
config: 'Config',
searchPages: 'Search pages...',
dropFiles: 'Drop files here or click to upload',
+ dropToUpload: 'Release to upload',
+ uploading: 'Uploading…',
+ uploadFailed: 'Upload failed: {name}',
addText: 'Add Text',
noRawMaterials: 'No raw materials yet',
reprocess: 'Reprocess',
@@ -1244,6 +1247,7 @@ export default {
saving: 'Saving...',
status: {
active: 'ACTIVE',
+ uploading: 'UPLOADING',
processing: 'PROCESSING',
error: 'ERROR',
pending: 'PENDING',
@@ -1253,6 +1257,7 @@ export default {
},
progress: {
preparing: 'Preparing…',
+ uploading: 'Uploading {pct}%',
},
jobStage: {
queued: 'Queued',
diff --git a/mateclaw-ui/src/i18n/locales/zh-CN.ts b/mateclaw-ui/src/i18n/locales/zh-CN.ts
index bb5aae20..e014e338 100644
--- a/mateclaw-ui/src/i18n/locales/zh-CN.ts
+++ b/mateclaw-ui/src/i18n/locales/zh-CN.ts
@@ -1232,6 +1232,9 @@ export default {
config: '处理配置',
searchPages: '搜索页面...',
dropFiles: '拖拽文件到此处或点击上传',
+ dropToUpload: '松开即开始上传',
+ uploading: '上传中…',
+ uploadFailed: '上传失败:{name}',
addText: '添加文本',
noRawMaterials: '暂无原始材料',
reprocess: '重新处理',
@@ -1254,6 +1257,7 @@ export default {
saving: '保存中...',
status: {
active: '启用',
+ uploading: '上传中',
processing: '处理中',
error: '错误',
pending: '待处理',
@@ -1263,6 +1267,7 @@ export default {
},
progress: {
preparing: '准备中…',
+ uploading: '上传 {pct}%',
},
jobStage: {
queued: '排队中',
diff --git a/mateclaw-ui/src/stores/useWikiStore.ts b/mateclaw-ui/src/stores/useWikiStore.ts
index f07d4112..32b07716 100644
--- a/mateclaw-ui/src/stores/useWikiStore.ts
+++ b/mateclaw-ui/src/stores/useWikiStore.ts
@@ -135,10 +135,10 @@ export const useWikiStore = defineStore('wiki', () => {
return raw
}
- async function uploadRawFile(kbId: number, file: File) {
+ async function uploadRawFile(kbId: number, file: File, onProgress?: (pct: number) => void) {
const formData = new FormData()
formData.append('file', file)
- const res: any = await wikiApi.uploadRaw(kbId, formData)
+ const res: any = await wikiApi.uploadRaw(kbId, formData, onProgress)
const raw = res.data || res
// Dedup: if backend returned an existing record, replace it in the list instead of adding a duplicate
const existingIdx = rawMaterials.value.findIndex(r => r.id === raw.id)
diff --git a/mateclaw-ui/src/views/Wiki/components/RawMaterialPanel.vue b/mateclaw-ui/src/views/Wiki/components/RawMaterialPanel.vue
index 266d0491..e3d9c2be 100644
--- a/mateclaw-ui/src/views/Wiki/components/RawMaterialPanel.vue
+++ b/mateclaw-ui/src/views/Wiki/components/RawMaterialPanel.vue
@@ -2,14 +2,36 @@
-
-