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

View File

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

View File

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

View File

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

View File

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

View File

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