This commit is contained in:
archer
2023-08-04 18:26:54 +08:00
parent 9a31407a01
commit a19c8b9106
4 changed files with 10 additions and 9 deletions

View File

@@ -35,7 +35,7 @@
"select a document": "select a document",
"support": "support {{fileExtension}} file",
"upload error description": "Only upload multiple files or one folder at a time",
"If the imported file is garbled, please convert CSV to utf-8 encoding format": "If the imported file is garbled, please convert CSV to utf-8 encoding format"
"If the imported file is garbled, please convert CSV to UTF-8 encoding format": "If the imported file is garbled, please convert CSV to UTF-8 encoding format"
},
"home": {
"Quickly build AI question and answer library": "Quickly build AI question and answer library",
@@ -75,4 +75,4 @@
"Update password succseful": "Update password succseful",
"Usage Record": "Usage"
}
}
}

View File

@@ -35,7 +35,7 @@
"select a document": "选择文件",
"support": "支持 {{fileExtension}} 文件",
"upload error description": "单次只支持上传多个文件或者一个文件夹",
"If the imported file is garbled, please convert CSV to utf-8 encoding format": "如果导入文件乱码,请将 CSV 转成 utf-8 编码格式"
"If the imported file is garbled, please convert CSV to UTF-8 encoding format": "如果导入文件乱码,请将 CSV 转成 UTF-8 编码格式"
},
"home": {
"Quickly build AI question and answer library": "快速搭建 AI 问答系统",
@@ -75,4 +75,4 @@
"Update password succseful": "修改密码成功",
"Usage Record": "使用记录"
}
}
}

View File

@@ -9,8 +9,7 @@ import {
NumberInputStepper,
NumberIncrementStepper,
NumberDecrementStepper,
Image,
Textarea
Image
} from '@chakra-ui/react';
import { useToast } from '@/hooks/useToast';
import { useConfirm } from '@/hooks/useConfirm';

View File

@@ -52,7 +52,7 @@ const CsvImport = ({ kbId }: { kbId: string }) => {
promise = promise.then(async () => {
const { header, data } = await readCsvContent(file);
if (header[0] !== 'question' || header[1] !== 'answer') {
throw new Error('csv 文件格式有误');
throw new Error('csv 文件格式有误,请确保 question 和 answer 两列');
}
setFiles((state) => [
@@ -73,7 +73,7 @@ const CsvImport = ({ kbId }: { kbId: string }) => {
} catch (error: any) {
console.log(error);
toast({
title: typeof error === 'string' ? error : '解析文件失败',
title: getErrText(error, '解析文件失败'),
status: 'error'
});
}
@@ -136,7 +136,9 @@ const CsvImport = ({ kbId }: { kbId: string }) => {
fileExtension={fileExtension}
onSelectFile={onSelectFile}
isLoading={selecting}
tipText={'If the imported file is garbled, please convert CSV to utf-8 encoding format'}
tipText={
'file.If the imported file is garbled, please convert CSV to UTF-8 encoding format'
}
py={emptyFiles ? '100px' : 5}
isCsv
/>