perf: tooltip

This commit is contained in:
archer
2023-07-23 22:39:55 +08:00
parent ea35ad2144
commit 6fd83e1e75
17 changed files with 187 additions and 401 deletions

View File

@@ -260,6 +260,7 @@ const ChunkImport = ({ kbId }: { kbId: string }) => {
<MyTooltip
label={'基于 Gpt3.5 的 Token 计算方法进行分段。前后段落会有 30% 的内容重叠。'}
forceShow
>
<QuestionOutlineIcon ml={1} />
</MyTooltip>
@@ -287,7 +288,10 @@ const ChunkImport = ({ kbId }: { kbId: string }) => {
<Flex py={5} alignItems={'center'}>
<Box>
<MyTooltip label={`索引生成计费为: ${formatPrice(unitPrice, 1000)}/1k tokens`}>
<MyTooltip
label={`索引生成计费为: ${formatPrice(unitPrice, 1000)}/1k tokens`}
forceShow
>
<QuestionOutlineIcon ml={1} />
</MyTooltip>
</Box>

View File

@@ -135,6 +135,7 @@ const CsvImport = ({ kbId }: { kbId: string }) => {
fileExtension={fileExtension}
onSelectFile={onSelectFile}
isLoading={selecting}
tipText={'如果导入文件乱码,请将 CSV 转成 utf-8 编码格式'}
py={emptyFiles ? '100px' : 5}
/>

View File

@@ -7,11 +7,12 @@ import MyIcon from '@/components/Icon';
interface Props extends BoxProps {
fileExtension: string;
tipText?: string;
onSelectFile: (files: File[]) => Promise<void>;
isLoading?: boolean;
}
const FileSelect = ({ fileExtension, onSelectFile, isLoading, ...props }: Props) => {
const FileSelect = ({ fileExtension, onSelectFile, isLoading, tipText, ...props }: Props) => {
const { Loading: FileSelectLoading } = useLoading();
const { File, onOpen } = useSelectFile({
@@ -41,6 +42,11 @@ const FileSelect = ({ fileExtension, onSelectFile, isLoading, ...props }: Props)
</Box>
</Flex>
<Box mt={1}> {fileExtension} </Box>
{tipText && (
<Box mt={1} fontSize={'sm'} color={'myGray.600'}>
{tipText}
</Box>
)}
<FileSelectLoading loading={isLoading} fixed={false} />
<File onSelect={onSelectFile} />
</Box>

View File

@@ -263,6 +263,7 @@ const QAImport = ({ kbId }: { kbId: string }) => {
QA {' '}
<MyTooltip
label={`可输入关于文件内容的范围介绍,例如:\n1. 关于 Laf 的介绍\n2. xxx的简历`}
forceShow
>
<QuestionOutlineIcon ml={1} />
</MyTooltip>
@@ -282,7 +283,10 @@ const QAImport = ({ kbId }: { kbId: string }) => {
<Flex py={5} alignItems={'center'}>
<Box>
<MyTooltip label={`索引生成计费为: ${formatPrice(unitPrice, 1000)}/1k tokens`}>
<MyTooltip
label={`索引生成计费为: ${formatPrice(unitPrice, 1000)}/1k tokens`}
forceShow
>
<QuestionOutlineIcon ml={1} />
</MyTooltip>
</Box>

View File

@@ -201,7 +201,7 @@ const Info = (
<Flex mt={8} alignItems={'center'} w={'100%'} flexWrap={'wrap'}>
<Box flex={['0 0 90px', '0 0 160px']} w={0}>
<MyTooltip label={'用空格隔开多个标签,便于搜索'}>
<MyTooltip label={'用空格隔开多个标签,便于搜索'} forceShow>
<QuestionOutlineIcon ml={1} />
</MyTooltip>
</Box>

View File

@@ -161,6 +161,7 @@ const Test = ({ kbId }: { kbId: string }) => {
label={
'根据知识库内容与测试文本的相似度进行排序,你可以根据测试结果调整对应的文本。\n注意测试记录中的数据可能已经被修改过点击某条测试数据后将展示最新的数据。'
}
forceShow
>
<QuestionOutlineIcon
ml={2}