Fix navbar (#2273)

* fix: phone navbar cannot scroll; fix: file uplaod process error

* perf: select repeat file
This commit is contained in:
Archer 2024-08-06 11:49:52 +08:00 committed by GitHub
parent f35ba8e5a7
commit 96ebec9809
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 61 additions and 52 deletions

View File

@ -38,8 +38,11 @@ curl --location --request POST 'https://{{host}}/api/admin/init/489' \
6. 商业版新增 - 知识库搜索节点支持标签过滤和创建时间过滤。 6. 商业版新增 - 知识库搜索节点支持标签过滤和创建时间过滤。
7. 新增 - 删除所有对话引导内容。 7. 新增 - 删除所有对话引导内容。
8. 优化 - 对话框信息懒加载,减少网络传输。 8. 优化 - 对话框信息懒加载,减少网络传输。
9. 修复 - 知识库上传文件,网络不稳定或文件较多情况下,进度无法到 100%。 9. 优化 - 清除选文件缓存,支持重复选择同一个文件。
10. 修复 - 删除应用后回到聊天选择最后一次对话的应用为删除的应用时提示无该应用问题。 10. 修复 - 知识库上传文件,网络不稳定或文件较多情况下,进度无法到 100%。
11. 修复 - 插件动态变量配置默认值时,无法正常显示默认值。 11. 修复 - 删除应用后回到聊天选择最后一次对话的应用为删除的应用时提示无该应用问题。
12. 修复 - 工具调用温度和最大回复值未生效。 12. 修复 - 插件动态变量配置默认值时,无法正常显示默认值。
13. 修复 - 函数调用模式assistant role 中GPT 模型必须传入 content 参数。(不影响大部分模型,目前基本都改用用 ToolChoice 模式FC 模式已弃用) 13. 修复 - 工具调用温度和最大回复值未生效。
14. 修复 - 函数调用模式assistant role 中GPT 模型必须传入 content 参数。(不影响大部分模型,目前基本都改用用 ToolChoice 模式FC 模式已弃用)。
15. 修复 - 知识库文件上传进度更新可能异常。
16. 修复 - 知识库 rebuilding 时候,页面总是刷新到第一页。

View File

@ -45,50 +45,51 @@ const LightRowTabs = <ValueType = string,>({
}, [size]); }, [size]);
return ( return (
<Grid <Box overflow={'auto'}>
gridTemplateColumns={`repeat(${list.length},1fr)`} <Grid
p={sizeMap.outP} gridTemplateColumns={`repeat(${list.length},1fr)`}
borderRadius={'sm'} p={sizeMap.outP}
fontSize={sizeMap.fontSize} borderRadius={'sm'}
overflowX={'auto'} fontSize={sizeMap.fontSize}
userSelect={'none'} userSelect={'none'}
display={'inline-grid'} display={'inline-grid'}
{...props} {...props}
> >
{list.map((item) => ( {list.map((item) => (
<Flex <Flex
key={item.value as string} key={item.value as string}
py={sizeMap.inlineP} py={sizeMap.inlineP}
alignItems={'center'} alignItems={'center'}
justifyContent={'center'} justifyContent={'center'}
borderBottom={'2px solid transparent'} borderBottom={'2px solid transparent'}
px={3} px={3}
whiteSpace={'nowrap'} whiteSpace={'nowrap'}
{...inlineStyles} {...inlineStyles}
{...(value === item.value {...(value === item.value
? { ? {
color: 'primary.600', color: 'primary.600',
cursor: 'default', cursor: 'default',
fontWeight: 'bold', fontWeight: 'bold',
borderBottomColor: 'primary.600' borderBottomColor: 'primary.600'
} }
: { : {
cursor: 'pointer' cursor: 'pointer'
})} })}
onClick={() => { onClick={() => {
if (value === item.value) return; if (value === item.value) return;
onChange(item.value); onChange(item.value);
}} }}
> >
{item.icon && ( {item.icon && (
<> <>
<Avatar src={item.icon} alt={''} w={'1.25rem'} borderRadius={'sm'} /> <Avatar src={item.icon} alt={''} w={'1.25rem'} borderRadius={'sm'} />
</> </>
)} )}
<Box ml={1}>{typeof item.label === 'string' ? t(item.label as any) : item.label}</Box> <Box ml={1}>{typeof item.label === 'string' ? t(item.label as any) : item.label}</Box>
</Flex> </Flex>
))} ))}
</Grid> </Grid>
</Box>
); );
}; };

View File

@ -124,7 +124,7 @@ const EditForm = ({
const selectedModel = const selectedModel =
llmModelList.find((item) => item.model === appForm.aiSettings.model) ?? llmModelList[0]; llmModelList.find((item) => item.model === appForm.aiSettings.model) ?? llmModelList[0];
const tokenLimit = useMemo(() => { const tokenLimit = useMemo(() => {
return selectedModel.quoteMaxToken || 3000; return selectedModel?.quoteMaxToken || 3000;
}, [selectedModel.quoteMaxToken]); }, [selectedModel.quoteMaxToken]);
return ( return (

View File

@ -154,7 +154,7 @@ const CollectionCard = () => {
useQuery( useQuery(
['refreshCollection'], ['refreshCollection'],
() => { () => {
getData(1); getData(pageNum);
if (datasetDetail.status === DatasetStatusEnum.syncing) { if (datasetDetail.status === DatasetStatusEnum.syncing) {
loadDatasetDetail(datasetDetail._id); loadDatasetDetail(datasetDetail._id);
} }

View File

@ -98,7 +98,9 @@ const FileSelector = ({
item.id === fileId item.id === fileId
? { ? {
...item, ...item,
uploadedFileRate: e uploadedFileRate: item.uploadedFileRate
? Math.max(e, item.uploadedFileRate)
: e
} }
: item : item
) )

View File

@ -26,6 +26,7 @@ export const useSelectFile = (props?: {
multiple={multiple} multiple={multiple}
onChange={(e) => { onChange={(e) => {
const files = e.target.files; const files = e.target.files;
if (!files || files?.length === 0) return; if (!files || files?.length === 0) return;
let fileList = Array.from(files); let fileList = Array.from(files);
@ -37,6 +38,8 @@ export const useSelectFile = (props?: {
fileList = fileList.slice(0, maxCount); fileList = fileList.slice(0, maxCount);
} }
onSelect(fileList, openSign.current); onSelect(fileList, openSign.current);
e.target.value = '';
}} }}
/> />
</Box> </Box>