fix: resolve routing, i18n, user management, UI, and OpenAPI/frontend configuration issues#21
fix: resolve routing, i18n, user management, UI, and OpenAPI/frontend configuration issues#21WangDaBenShi wants to merge 104 commits intoLazyAGI:mainfrom
Conversation
fix: 创建prompt接口参数错误
\n- Integrate JuiceFS S3 gateway and MinIO backend into compose\n- Add user guide and initialization/testing helpers\n Made-with: Cursor
feat(juicefs): add juicefs s3 gateway integration
refactor(docs): update references from LazyRAG
style(utils): standardize string quotes in generate_bucket_name function
style(utils): standardize string quotes in generate_bucket_name function
fix: 创建prompt接口参数错误
…ss multiple files
- Updated the OpenAPI cache with a new core hash. - Removed deprecated endpoints from core.yaml, including tasks:callback and allDefaultDatasets. - Cleaned up generated API client code by removing unused methods related to the removed endpoints. - Enhanced the KnowledgeBaseServiceApi with new dataset management methods and JSON request handling. - Removed the industry selection field from the UpdateModal component for a streamlined user experience.
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive set of updates to the frontend, including improvements to the OpenAPI client generation workflow with stale-check mechanisms, a transition from HashRouter to BrowserRouter, and enhanced internationalization (i18n) support across UI components. Administrative features have been expanded with user enable/disable functionality and a refactored group member management modal. Additionally, the knowledge base module now supports folder uploads via relative paths, and navigation logic has been updated to use React Router hooks consistently. Feedback focuses on scalability issues related to hardcoded page sizes for prompt fetching and performance bottlenecks in the sequential file upload logic for folders.
| function fetchPromptList() { | ||
| PromptServiceApi() | ||
| .promptServiceListPrompts({ pageSize: 2 }) | ||
| .promptServiceListPrompts({ pageSize: 9999 }) |
There was a problem hiding this comment.
Using a hardcoded pageSize of 9999 is a scalability anti-pattern. While it ensures all prompts are fetched for now, it can lead to performance issues and large payload sizes as the number of prompts grows. Consider implementing proper pagination or at least using a more reasonable limit with a constant.
| for (const item of fileItems) { | ||
| if (item.originFile.size > LARGE_FILE_THRESHOLD) { | ||
| // Large file: multi-step upload with relative_path | ||
| const uploadFileId = await uploadLargeFileToDataset( | ||
| data.dataset_id, | ||
| item.originFile, | ||
| { documentPid: data.p_id, relativePath: item.path }, | ||
| ); | ||
| uploadedItems.push({ | ||
| upload_file_id: uploadFileId, | ||
| relative_path: item.path, | ||
| }); | ||
| } else { | ||
| // Small file: single upload with relative_path in form data | ||
| const formData = new FormData(); | ||
| formData.append("files", item.originFile); | ||
| formData.append("relative_path", item.path); | ||
| if (data.p_id) formData.append("document_pid", data.p_id); | ||
|
|
||
| const uploadRes = await TaskServiceApi().uploadFiles( | ||
| data.dataset_id, | ||
| formData, | ||
| ); | ||
| const uploaded = uploadRes.data.files || []; | ||
| if (!uploaded.length) { | ||
| throw new Error(t("knowledge.uploadResultMissing")); | ||
| } | ||
| uploadedFiles.forEach((f) => allUploadFileIds.push(f.upload_file_id)); | ||
| } | ||
|
|
||
| for (const file of largeFiles) { | ||
| const uploadFileId = await uploadLargeFileToDataset(data.dataset_id, file, { | ||
| documentPid: data.p_id, | ||
| uploadedItems.push({ | ||
| upload_file_id: uploaded[0].upload_file_id!, | ||
| relative_path: item.path, | ||
| }); | ||
| allUploadFileIds.push(uploadFileId); | ||
| } | ||
| } |
There was a problem hiding this comment.
In submitFolderMode, files are uploaded sequentially one by one. For folders containing many small files, this will result in a significant performance bottleneck due to the overhead of multiple HTTP requests. Consider batching small files or using Promise.all with a concurrency limit to parallelize the uploads.
…up functionality and simplifying action button rendering logic.
…ed members from selection and updating user list structure to include disabled status.
…oints, enhance API client, and update localization for success messages.
… update logo handling and improve layout responsiveness.
Summary
This PR fixes multiple issues across routing, i18n, user management, UI behavior, and OpenAPI/frontend configuration. It also includes several follow-up fixes after review.
Changes
Configuration & Infrastructure
Routing & Knowledge Base
User Management
UI & Interaction
i18n