Skip to content

Commit

Permalink
doc (#3383)
Browse files Browse the repository at this point in the history
* doc

* feat: navbar size

* navbar ui
  • Loading branch information
c121914yu authored Dec 12, 2024
1 parent ddddd99 commit e71708e
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 50 deletions.
2 changes: 1 addition & 1 deletion docSite/content/zh-cn/docs/development/upgrading/4815.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ weight: 809

## 升级指南

- 更新 fastgpt 镜像 tag: v4.8.15-fix-team-permission
- 更新 fastgpt 镜像 tag: v4.8.15-fix
- 更新 fastgpt-pro 商业版镜像 tag: v4.8.15
- Sandbox 镜像,可以不更新

Expand Down
4 changes: 2 additions & 2 deletions files/docker/docker-compose-milvus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ services:
restart: always
fastgpt:
container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.8.15-fix-emb-page # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15-fix-emb-page # 阿里云
image: ghcr.io/labring/fastgpt:v4.8.15-fix # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15-fix # 阿里云
ports:
- 3000:3000
networks:
Expand Down
4 changes: 2 additions & 2 deletions files/docker/docker-compose-pgvector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ services:
restart: always
fastgpt:
container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.8.15-fix-emb-page # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15-fix-emb-page # 阿里云
image: ghcr.io/labring/fastgpt:v4.8.15-fix # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15-fix # 阿里云
ports:
- 3000:3000
networks:
Expand Down
4 changes: 2 additions & 2 deletions files/docker/docker-compose-zilliz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ services:
restart: always
fastgpt:
container_name: fastgpt
image: ghcr.io/labring/fastgpt:v4.8.15-fix-emb-page # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15-fix-emb-page # 阿里云
image: ghcr.io/labring/fastgpt:v4.8.15-fix # git
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.8.15-fix # 阿里云
ports:
- 3000:3000
networks:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 50 additions & 39 deletions projects/app/src/components/Layout/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,44 +121,55 @@ const Navbar = ({ unread }: { unread: number }) => {
</Box>
{/* 导航列表 */}
<Box flex={1}>
{navbarList.map((item) => (
<Box
key={item.link}
{...itemStyles}
{...(item.activeLink.includes(router.pathname)
? {
color: 'primary.600',
bg: 'white',
boxShadow:
'0px 0px 1px 0px rgba(19, 51, 107, 0.08), 0px 4px 4px 0px rgba(19, 51, 107, 0.05)'
}
: {
color: 'myGray.500',
bg: 'transparent',
_hover: {
bg: isSecondNavbarPage ? 'white' : 'rgba(255,255,255,0.9)'
{navbarList.map((item) => {
const isActive = item.activeLink.includes(router.pathname);
return (
<Box
key={item.link}
{...itemStyles}
{...(isActive
? {
bg: 'white',
boxShadow:
'0px 0px 1px 0px rgba(19, 51, 107, 0.08), 0px 4px 4px 0px rgba(19, 51, 107, 0.05)'
}
})}
{...(item.link !== router.asPath
? {
onClick: () => router.push(item.link)
}
: {})}
>
<MyIcon
name={
item.activeLink.includes(router.pathname)
? (item.activeIcon as any)
: (item.icon as any)
}
width={'20px'}
height={'20px'}
/>
<Box fontSize={'12px'} transform={'scale(0.9)'} mt={'5px'} lineHeight={1}>
{item.label}
: {
bg: 'transparent',
_hover: {
bg: isSecondNavbarPage ? 'white' : 'rgba(255,255,255,0.9)'
}
})}
{...(item.link !== router.asPath
? {
onClick: () => router.push(item.link)
}
: {})}
>
<MyIcon
{...(isActive
? {
name: item.activeIcon as any,
color: 'primary.600'
}
: {
name: item.icon as any,
color: 'myGray.400'
})}
width={'20px'}
height={'20px'}
/>
<Box
fontSize={'12px'}
transform={'scale(0.9)'}
mt={'5px'}
lineHeight={1}
color={isActive ? 'primary.700' : 'myGray.500'}
>
{item.label}
</Box>
</Box>
</Box>
))}
);
})}
</Box>

{unread > 0 && (
Expand Down Expand Up @@ -191,10 +202,10 @@ const Navbar = ({ unread }: { unread: number }) => {
{...itemStyles}
{...hoverStyle}
mt={0}
color={'myGray.500'}
color={'myGray.400'}
height={'48px'}
>
<Avatar src={item.avatar} borderRadius={'md'} />
<Avatar src={item.avatar} borderRadius={'md'} width={'26px'} height={'26px'} />
</Link>
</MyTooltip>
))}
Expand All @@ -208,7 +219,7 @@ const Navbar = ({ unread }: { unread: number }) => {
{...itemStyles}
{...hoverStyle}
mt={0}
color={'myGray.500'}
color={'myGray.400'}
height={'48px'}
>
<MyIcon name={'common/gitInlight'} width={'26px'} height={'26px'} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,16 @@ const VariableInput = ({
const variablesForm = useContextSelector(ChatItemContext, (v) => v.variablesForm);
const variableList = useContextSelector(ChatBoxContext, (v) => v.variableList);

const { handleSubmit: handleSubmitChat } = variablesForm;
const { getValues, setValue, handleSubmit: handleSubmitChat } = variablesForm;

useEffect(() => {
variableList.forEach((item) => {
const val = getValues(`variables.${item.key}`);
if (item.defaultValue !== undefined && (val === undefined || val === null || val === '')) {
setValue(`variables.${item.key}`, item.defaultValue);
}
});
}, [variableList]);

return (
<Box py={3}>
Expand Down

0 comments on commit e71708e

Please sign in to comment.