Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
9384419c
authored
Mar 18, 2023
by
Archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 模型数量增加。滚动条位置
parent
38c093d9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
29 deletions
+32
-29
src/pages/api/model/create.ts
+2
-2
src/pages/chat/components/SlideBar.tsx
+30
-27
No files found.
src/pages/api/model/create.ts
View file @
9384419c
...
...
@@ -43,8 +43,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
const
authCount
=
await
Model
.
countDocuments
({
userId
});
if
(
authCount
>=
5
)
{
throw
new
Error
(
'上限
5
个模型'
);
if
(
authCount
>=
10
)
{
throw
new
Error
(
'上限
10
个模型'
);
}
// 创建模型
...
...
src/pages/chat/components/SlideBar.tsx
View file @
9384419c
...
...
@@ -98,17 +98,18 @@ const SlideBar = ({
flexDirection=
{
'column'
}
w=
{
'100%'
}
h=
{
'100%'
}
p=
{
3
}
p
y
=
{
3
}
backgroundColor=
{
'blackAlpha.800'
}
color=
{
'white'
}
>
{
/* 新对话 */
}
{
getToken
()
&&
(
<
Button
w=
{
'
10
0%'
}
w=
{
'
9
0%'
}
variant=
{
'white'
}
h=
{
'40px'
}
mb=
{
4
}
mx=
{
'auto'
}
leftIcon=
{
<
AddIcon
/>
}
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
?
(
<
Accordion
defaultIndex=
{
[
0
]
}
allowToggle
>
<
AccordionItem
borderTop=
{
0
}
borderBottom=
{
0
}
>
...
...
@@ -185,9 +186,30 @@ const SlideBar = ({
<
Divider
my=
{
4
}
/>
{
/* 分享 */
}
{
getToken
()
&&
(
<
Box
px=
{
3
}
>
{
/* 分享 */
}
{
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
mt=
{
4
}
alignItems=
{
'center'
}
p=
{
2
}
cursor=
{
'pointer'
}
...
...
@@ -196,32 +218,13 @@ const SlideBar = ({
backgroundColor
:
'rgba(255,255,255,0.2)'
}
}
onClick=
{
async
()
=>
{
copyData
(
`${location.origin}/chat?chatId=${await generateChatWindow(modelId)}`
,
'已复制分享链接'
);
copyData
(
`${location.origin}/chat?chatId=${chatId}`
,
'已复制分享链接'
);
}
}
>
<
MyIcon
name=
"share"
fill=
{
'white'
}
w=
{
'16px'
}
h=
{
'16px'
}
mr=
{
4
}
/>
分享
空白
对话
分享
当前
对话
</
Flex
>
)
}
<
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
>
</
Box
>
</
Flex
>
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment