mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 01:40:51 +00:00
feat: 模型数量增加。滚动条位置
This commit is contained in:
@@ -43,8 +43,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
|||||||
const authCount = await Model.countDocuments({
|
const authCount = await Model.countDocuments({
|
||||||
userId
|
userId
|
||||||
});
|
});
|
||||||
if (authCount >= 5) {
|
if (authCount >= 10) {
|
||||||
throw new Error('上限5个模型');
|
throw new Error('上限 10 个模型');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建模型
|
// 创建模型
|
||||||
|
@@ -98,17 +98,18 @@ const SlideBar = ({
|
|||||||
flexDirection={'column'}
|
flexDirection={'column'}
|
||||||
w={'100%'}
|
w={'100%'}
|
||||||
h={'100%'}
|
h={'100%'}
|
||||||
p={3}
|
py={3}
|
||||||
backgroundColor={'blackAlpha.800'}
|
backgroundColor={'blackAlpha.800'}
|
||||||
color={'white'}
|
color={'white'}
|
||||||
>
|
>
|
||||||
{/* 新对话 */}
|
{/* 新对话 */}
|
||||||
{getToken() && (
|
{getToken() && (
|
||||||
<Button
|
<Button
|
||||||
w={'100%'}
|
w={'90%'}
|
||||||
variant={'white'}
|
variant={'white'}
|
||||||
h={'40px'}
|
h={'40px'}
|
||||||
mb={4}
|
mb={4}
|
||||||
|
mx={'auto'}
|
||||||
leftIcon={<AddIcon />}
|
leftIcon={<AddIcon />}
|
||||||
onClick={resetChat}
|
onClick={resetChat}
|
||||||
>
|
>
|
||||||
@@ -117,7 +118,7 @@ const SlideBar = ({
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* 我的模型 & 历史记录 折叠框*/}
|
{/* 我的模型 & 历史记录 折叠框*/}
|
||||||
<Box flex={'1 0 0'} h={0} overflowY={'auto'}>
|
<Box flex={'1 0 0'} px={3} h={0} overflowY={'auto'}>
|
||||||
{isSuccess ? (
|
{isSuccess ? (
|
||||||
<Accordion defaultIndex={[0]} allowToggle>
|
<Accordion defaultIndex={[0]} allowToggle>
|
||||||
<AccordionItem borderTop={0} borderBottom={0}>
|
<AccordionItem borderTop={0} borderBottom={0}>
|
||||||
@@ -185,9 +186,30 @@ const SlideBar = ({
|
|||||||
|
|
||||||
<Divider my={4} />
|
<Divider my={4} />
|
||||||
|
|
||||||
{/* 分享 */}
|
<Box px={3}>
|
||||||
{getToken() && (
|
{/* 分享 */}
|
||||||
|
{getToken() && (
|
||||||
|
<Flex
|
||||||
|
alignItems={'center'}
|
||||||
|
p={2}
|
||||||
|
cursor={'pointer'}
|
||||||
|
borderRadius={'md'}
|
||||||
|
_hover={{
|
||||||
|
backgroundColor: 'rgba(255,255,255,0.2)'
|
||||||
|
}}
|
||||||
|
onClick={async () => {
|
||||||
|
copyData(
|
||||||
|
`${location.origin}/chat?chatId=${await generateChatWindow(modelId)}`,
|
||||||
|
'已复制分享链接'
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MyIcon name="share" fill={'white'} w={'16px'} h={'16px'} mr={4} />
|
||||||
|
分享空白对话
|
||||||
|
</Flex>
|
||||||
|
)}
|
||||||
<Flex
|
<Flex
|
||||||
|
mt={4}
|
||||||
alignItems={'center'}
|
alignItems={'center'}
|
||||||
p={2}
|
p={2}
|
||||||
cursor={'pointer'}
|
cursor={'pointer'}
|
||||||
@@ -196,32 +218,13 @@ const SlideBar = ({
|
|||||||
backgroundColor: 'rgba(255,255,255,0.2)'
|
backgroundColor: 'rgba(255,255,255,0.2)'
|
||||||
}}
|
}}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
copyData(
|
copyData(`${location.origin}/chat?chatId=${chatId}`, '已复制分享链接');
|
||||||
`${location.origin}/chat?chatId=${await generateChatWindow(modelId)}`,
|
|
||||||
'已复制分享链接'
|
|
||||||
);
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<MyIcon name="share" fill={'white'} w={'16px'} h={'16px'} mr={4} />
|
<MyIcon name="share" fill={'white'} w={'16px'} h={'16px'} mr={4} />
|
||||||
分享空白对话
|
分享当前对话
|
||||||
</Flex>
|
</Flex>
|
||||||
)}
|
</Box>
|
||||||
<Flex
|
|
||||||
mt={4}
|
|
||||||
alignItems={'center'}
|
|
||||||
p={2}
|
|
||||||
cursor={'pointer'}
|
|
||||||
borderRadius={'md'}
|
|
||||||
_hover={{
|
|
||||||
backgroundColor: 'rgba(255,255,255,0.2)'
|
|
||||||
}}
|
|
||||||
onClick={async () => {
|
|
||||||
copyData(`${location.origin}/chat?chatId=${chatId}`, '已复制分享链接');
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<MyIcon name="share" fill={'white'} w={'16px'} h={'16px'} mr={4} />
|
|
||||||
分享当前对话
|
|
||||||
</Flex>
|
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user