perf: 文案;feat: 知识库模糊搜索

This commit is contained in:
archer
2023-04-13 21:34:36 +08:00
parent ff24042df5
commit 56a0b48b97
9 changed files with 62 additions and 43 deletions

View File

@@ -16,6 +16,7 @@ import { formatModelStatus } from '@/constants/model';
import dayjs from 'dayjs';
import type { ModelSchema } from '@/types/mongoSchema';
import { useRouter } from 'next/router';
import { modelList } from '@/constants/model';
const ModelTable = ({
models = [],
@@ -31,6 +32,15 @@ const ModelTable = ({
key: 'name',
dataIndex: 'name'
},
{
title: '模型类型',
key: 'service',
render: (model: ModelSchema) => (
<Box fontWeight={'bold'} whiteSpace={'pre-wrap'} maxW={'200px'}>
{modelList.find((item) => item.model === model.service.modelName)?.name}
</Box>
)
},
{
title: '最后更新时间',
key: 'updateTime',
@@ -51,29 +61,20 @@ const ModelTable = ({
</Tag>
)
},
{
title: 'AI模型',
key: 'service',
render: (item: ModelSchema) => (
<Box wordBreak={'break-all'} whiteSpace={'pre-wrap'} maxW={'200px'}>
{item.service.modelName}
</Box>
)
},
{
title: '操作',
key: 'control',
render: (item: ModelSchema) => (
<>
<Button mr={3} onClick={() => handlePreviewChat(item._id)}>
</Button>
<Button
colorScheme={'gray'}
mr={3}
variant={'outline'}
onClick={() => router.push(`/model/detail?modelId=${item._id}`)}
>
</Button>
<Button onClick={() => handlePreviewChat(item._id)}></Button>
</>
)
}