feat: Enhance file upload functionality with progress tracking
- Updated the `uploadKnowledgeFile` function to accept an optional progress callback, enabling real-time upload progress tracking. - Refactored the document upload handling in the menu component to support multiple file uploads with individual progress events. - Removed deprecated document processing state management from the KnowledgeBase view, streamlining the upload process. - Improved user feedback during file uploads by dispatching events for upload start, progress, and completion.
This commit is contained in:
@@ -40,8 +40,8 @@ export function copyKnowledgeBase(data: { source_id: string; target_id?: string
|
||||
}
|
||||
|
||||
// 知识文件 API(基于具体知识库)
|
||||
export function uploadKnowledgeFile(kbId: string, data = {}) {
|
||||
return postUpload(`/api/v1/knowledge-bases/${kbId}/knowledge/file`, data);
|
||||
export function uploadKnowledgeFile(kbId: string, data = {}, onProgress?: (progressEvent: any) => void) {
|
||||
return postUpload(`/api/v1/knowledge-bases/${kbId}/knowledge/file`, data, onProgress);
|
||||
}
|
||||
|
||||
export function createKnowledgeFromURL(kbId: string, data: { url: string; enable_multimodel?: boolean }) {
|
||||
|
||||
Reference in New Issue
Block a user