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 }) || ''

View File

@@ -31,7 +31,7 @@ const Kb = () => {
const { toast } = useToast();
const { openConfirm, ConfirmModal } = useConfirm({
title: '删除提示',
content: '确认删除该知识库?'
content: '确认删除该知识库?知识库相关的文件、记录将永久删除,无法恢复!'
});
const { myKbList, loadKbList, setKbList } = useUserStore();