mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? fix: #567 use modal to upload files in the knowledge base ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -184,12 +184,12 @@ export const useUploadDocument = () => {
|
||||
const { knowledgeId } = useGetKnowledgeSearchParams();
|
||||
|
||||
const uploadDocument = useCallback(
|
||||
(file: UploadFile) => {
|
||||
(fileList: UploadFile[]) => {
|
||||
try {
|
||||
return dispatch<any>({
|
||||
type: 'kFModel/upload_document',
|
||||
payload: {
|
||||
file,
|
||||
fileList,
|
||||
kb_id: knowledgeId,
|
||||
},
|
||||
});
|
||||
|
||||
@ -5,6 +5,7 @@ import {
|
||||
IThirdOAIModelCollection,
|
||||
} from '@/interfaces/database/llm';
|
||||
import { IAddLlmRequestBody } from '@/interfaces/request/llm';
|
||||
import { sortLLmFactoryListBySpecifiedOrder } from '@/utils/commonUtil';
|
||||
import { useCallback, useEffect, useMemo } from 'react';
|
||||
import { useDispatch, useSelector } from 'umi';
|
||||
|
||||
@ -110,13 +111,12 @@ export const useFetchLlmFactoryListOnMount = () => {
|
||||
const factoryList = useSelectLlmFactoryList();
|
||||
const myLlmList = useSelectMyLlmList();
|
||||
|
||||
const list = useMemo(
|
||||
() =>
|
||||
factoryList.filter((x) =>
|
||||
Object.keys(myLlmList).every((y) => y !== x.name),
|
||||
),
|
||||
[factoryList, myLlmList],
|
||||
);
|
||||
const list = useMemo(() => {
|
||||
const currentList = factoryList.filter((x) =>
|
||||
Object.keys(myLlmList).every((y) => y !== x.name),
|
||||
);
|
||||
return sortLLmFactoryListBySpecifiedOrder(currentList);
|
||||
}, [factoryList, myLlmList]);
|
||||
|
||||
const fetchLlmFactoryList = useCallback(() => {
|
||||
dispatch({
|
||||
|
||||
Reference in New Issue
Block a user