feat: file relate kb

This commit is contained in:
archer
2023-09-04 10:51:57 +08:00
parent a3c6d6800b
commit 44e772f0fd
7 changed files with 50 additions and 26 deletions

View File

@@ -19,6 +19,7 @@ import dynamic from 'next/dynamic';
import MyTooltip from '@/components/MyTooltip';
import { FetchResultItem, DatasetItemType } from '@/types/plugin';
import { getErrText } from '@/utils/tools';
import { useUserStore } from '@/store/user';
const UrlFetchModal = dynamic(() => import('./UrlFetchModal'));
const CreateFileModal = dynamic(() => import('./CreateFileModal'));
@@ -54,6 +55,7 @@ const FileSelect = ({
showCreateFile = true,
...props
}: Props) => {
const { kbDetail } = useUserStore();
const { Loading: FileSelectLoading } = useLoading();
const { t } = useTranslation();
@@ -109,7 +111,7 @@ const FileSelect = ({
}
return '';
})(),
uploadFiles([file], (percent) => {
uploadFiles([file], { kbId: kbDetail._id }, (percent) => {
if (percent < 100) {
setSelectingText(
t('file.Uploading', { name: file.name.slice(0, 20), percent }) || ''