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:
wizardchen
2025-11-24 00:21:42 +08:00
parent 057cfd9eb0
commit 4a2be2b878
12 changed files with 790 additions and 532 deletions
+9 -2
View File
@@ -14,8 +14,9 @@ import (
type AsynqTaskParams struct {
dig.In
Server *asynq.Server
Extracter interfaces.Extracter
Server *asynq.Server
Extracter interfaces.Extracter
KnowledgeService interfaces.KnowledgeService
}
func getAsynqRedisClientOpt() *asynq.RedisClientOpt {
@@ -60,6 +61,12 @@ func RunAsynqServer(params AsynqTaskParams) *asynq.ServeMux {
mux.HandleFunc(types.TypeChunkExtract, params.Extracter.Extract)
// Register document processing handler
mux.HandleFunc(types.TypeDocumentProcess, params.KnowledgeService.ProcessDocument)
// Register FAQ import handler
mux.HandleFunc(types.TypeFAQImport, params.KnowledgeService.ProcessFAQImport)
go func() {
// Start the server
if err := params.Server.Run(mux); err != nil {