4.8.11 test (#2850)

* fix: variables check

* remove log

* fix: variables refresh

* perf: team select button

* perf: remove change fn
This commit is contained in:
Archer
2024-10-04 10:25:20 +08:00
committed by shilin66
parent 354828262d
commit a735e4eca9
7 changed files with 91 additions and 85 deletions

View File

@@ -7,6 +7,7 @@ import dynamic from 'next/dynamic';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import { useToast } from '@fastgpt/web/hooks/useToast';
import Avatar from '@fastgpt/web/components/common/Avatar';
import MyIcon from '@fastgpt/web/components/common/Icon';
const TeamManageModal = dynamic(() => import('../TeamManageModal'));
@@ -19,47 +20,50 @@ const TeamMenu = () => {
const { isOpen, onOpen, onClose } = useDisclosure();
return (
<Button
variant={'whitePrimary'}
userSelect={'none'}
w={'100%'}
display={'block'}
h={'34px'}
px={3}
css={{
'& span': {
display: 'block'
}
}}
transform={'none !important'}
onClick={() => {
if (feConfigs.isPlus) {
onOpen();
} else {
toast({
status: 'warning',
title: t('common:common.system.Commercial version function')
});
}
}}
>
<MyTooltip label={t('common:user.team.Select Team')}>
<Flex w={'100%'} alignItems={'center'}>
{userInfo?.team ? (
<>
<Avatar src={userInfo.team.avatar} w={'1rem'} />
<Box ml={2}>{userInfo.team.teamName}</Box>
</>
) : (
<>
<Box w={'8px'} h={'8px'} mr={3} borderRadius={'50%'} bg={'#67c13b'} />
{t('common:user.team.Personal Team')}
</>
)}
</Flex>
</MyTooltip>
<>
<Button
variant={'whitePrimary'}
userSelect={'none'}
w={'100%'}
h={'34px'}
justifyContent={'space-between'}
px={3}
css={{
'& span': {
display: 'block'
}
}}
transform={'none !important'}
rightIcon={<MyIcon w={'1rem'} name={'common/select'} />}
onClick={() => {
if (feConfigs.isPlus) {
onOpen();
} else {
toast({
status: 'warning',
title: t('common:common.system.Commercial version function')
});
}
}}
>
<MyTooltip label={t('common:user.team.Select Team')}>
<Flex w={'100%'} alignItems={'center'}>
{userInfo?.team ? (
<>
<Avatar src={userInfo.team.avatar} w={'1rem'} />
<Box ml={2}>{userInfo.team.teamName}</Box>
</>
) : (
<>
<Box w={'8px'} h={'8px'} mr={3} borderRadius={'50%'} bg={'#67c13b'} />
{t('common:user.team.Personal Team')}
</>
)}
</Flex>
</MyTooltip>
</Button>
{isOpen && <TeamManageModal onClose={onClose} />}
</Button>
</>
);
};