mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-02 20:58:12 +00:00
4.6.7 fix (#752)
This commit is contained in:
@@ -27,7 +27,7 @@ const Upload = dynamic(() => import('../commonProgress/Upload'));
|
||||
const PreviewRawText = dynamic(() => import('../components/PreviewRawText'));
|
||||
|
||||
type FileItemType = ImportSourceItemType & { file: File };
|
||||
const fileType = '.txt, .docx, .pdf, .md, .html';
|
||||
const fileType = '.txt, .docx, .csv, .pdf, .md, .html';
|
||||
const maxSelectFileCount = 1000;
|
||||
|
||||
const FileLocal = ({ activeStep, goToNext }: ImportDataComponentProps) => {
|
||||
|
@@ -14,7 +14,8 @@ import { useImportStore } from '../Provider';
|
||||
import { feConfigs } from '@/web/common/system/staticData';
|
||||
|
||||
import dynamic from 'next/dynamic';
|
||||
import { fileDownload, readCsvContent } from '@/web/common/file/utils';
|
||||
import { fileDownload } from '@/web/common/file/utils';
|
||||
import { readCsvContent } from '@fastgpt/web/common/file/read/csv';
|
||||
|
||||
const PreviewData = dynamic(() => import('../commonProgress/PreviewData'));
|
||||
const Upload = dynamic(() => import('../commonProgress/Upload'));
|
||||
@@ -56,7 +57,7 @@ const SelectFile = React.memo(function SelectFile({ goToNext }: { goToNext: () =
|
||||
{
|
||||
for await (const selectFile of files) {
|
||||
const { file, folderPath } = selectFile;
|
||||
const { header, data } = await readCsvContent(file);
|
||||
const { header, data } = await readCsvContent({ file });
|
||||
|
||||
const filterData: FileItemType['chunks'] = data
|
||||
.filter((item) => item[0])
|
||||
|
@@ -193,7 +193,10 @@ const InputDataModal = ({
|
||||
// not exactly same
|
||||
await putDatasetDataById({
|
||||
id: dataId,
|
||||
...e
|
||||
...e,
|
||||
indexes: e.indexes.map((index) =>
|
||||
index.defaultIndex ? getDefaultIndex({ q: e.q, a: e.a }) : index
|
||||
)
|
||||
});
|
||||
|
||||
return {
|
||||
|
@@ -35,7 +35,8 @@ import dynamic from 'next/dynamic';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import MySelect from '@/components/Select';
|
||||
import { useSelectFile } from '@/web/common/file/hooks/useSelectFile';
|
||||
import { fileDownload, readCsvContent } from '@/web/common/file/utils';
|
||||
import { fileDownload } from '@/web/common/file/utils';
|
||||
import { readCsvContent } from '@fastgpt/web/common/file/read/csv';
|
||||
import { delay } from '@fastgpt/global/common/system/utils';
|
||||
import QuoteItem from '@/components/core/dataset/QuoteItem';
|
||||
|
||||
@@ -125,7 +126,7 @@ const Test = ({ datasetId }: { datasetId: string }) => {
|
||||
const { mutate: onFileTest, isLoading: fileTestIsLoading } = useRequest({
|
||||
mutationFn: async ({ searchParams }: FormType) => {
|
||||
if (!selectFile) return Promise.reject('File is not selected');
|
||||
const { data } = await readCsvContent(selectFile);
|
||||
const { data } = await readCsvContent({ file: selectFile });
|
||||
const testList = data.slice(0, 100);
|
||||
const results: SearchTestResponse[] = [];
|
||||
|
||||
|
Reference in New Issue
Block a user