Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix navbar #2273

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions docSite/content/zh-cn/docs/development/upgrading/489.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 时候,页面总是刷新到第一页。
89 changes: 45 additions & 44 deletions packages/web/components/common/Tabs/LightRowTabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const CollectionCard = () => {
useQuery(
['refreshCollection'],
() => {
getData(1);
getData(pageNum);
if (datasetDetail.status === DatasetStatusEnum.syncing) {
loadDatasetDetail(datasetDetail._id);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ const FileSelector = ({
item.id === fileId
? {
...item,
uploadedFileRate: e
uploadedFileRate: item.uploadedFileRate
? Math.max(e, item.uploadedFileRate)
: e
}
: item
)
Expand Down
3 changes: 3 additions & 0 deletions projects/app/src/web/common/file/hooks/useSelectFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -37,6 +38,8 @@ export const useSelectFile = (props?: {
fileList = fileList.slice(0, maxCount);
}
onSelect(fileList, openSign.current);

e.target.value = '';
}}
/>
</Box>
Expand Down
Loading