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
ca4cd8af
authored
Jun 12, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: sse
parent
36a0ea7e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
12 deletions
+12
-12
client/src/pages/api/chat/chat.ts
+1
-1
client/src/pages/api/chat/shareChat/chat.ts
+1
-1
client/src/pages/api/openapi/chat/chat.ts
+1
-1
client/src/pages/chat/index.tsx
+1
-1
client/src/pages/model/components/detail/components/ModelEditForm.tsx
+3
-3
client/src/pages/number/components/BillTable.tsx
+2
-2
client/src/pages/number/components/InformTable.tsx
+1
-1
client/src/pages/number/components/PayRecordTable.tsx
+1
-1
client/src/pages/number/components/PromotionTable.tsx
+1
-1
No files found.
client/src/pages/api/chat/chat.ts
View file @
ca4cd8af
...
@@ -58,7 +58,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
...
@@ -58,7 +58,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
guidePrompt
=
''
guidePrompt
=
''
}
=
await
(
async
()
=>
{
}
=
await
(
async
()
=>
{
// 使用了知识库搜索
// 使用了知识库搜索
if
(
model
.
chat
.
relatedKbs
.
length
>
0
)
{
if
(
model
.
chat
.
relatedKbs
?
.
length
>
0
)
{
const
{
code
,
searchPrompts
,
rawSearch
,
guidePrompt
}
=
await
appKbSearch
({
const
{
code
,
searchPrompts
,
rawSearch
,
guidePrompt
}
=
await
appKbSearch
({
model
,
model
,
userId
,
userId
,
...
...
client/src/pages/api/chat/shareChat/chat.ts
View file @
ca4cd8af
...
@@ -43,7 +43,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
...
@@ -43,7 +43,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const
{
code
=
200
,
systemPrompts
=
[]
}
=
await
(
async
()
=>
{
const
{
code
=
200
,
systemPrompts
=
[]
}
=
await
(
async
()
=>
{
// 使用了知识库搜索
// 使用了知识库搜索
if
(
model
.
chat
.
relatedKbs
.
length
>
0
)
{
if
(
model
.
chat
.
relatedKbs
?
.
length
>
0
)
{
const
{
code
,
searchPrompts
}
=
await
appKbSearch
({
const
{
code
,
searchPrompts
}
=
await
appKbSearch
({
model
,
model
,
userId
,
userId
,
...
...
client/src/pages/api/openapi/chat/chat.ts
View file @
ca4cd8af
...
@@ -73,7 +73,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
...
@@ -73,7 +73,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
}[]
=
[];
}[]
=
[];
// 使用了知识库搜索
// 使用了知识库搜索
if
(
model
.
chat
.
relatedKbs
.
length
>
0
)
{
if
(
model
.
chat
.
relatedKbs
?
.
length
>
0
)
{
const
{
code
,
searchPrompts
}
=
await
appKbSearch
({
const
{
code
,
searchPrompts
}
=
await
appKbSearch
({
model
,
model
,
userId
,
userId
,
...
...
client/src/pages/chat/index.tsx
View file @
ca4cd8af
...
@@ -645,7 +645,7 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
...
@@ -645,7 +645,7 @@ const Chat = ({ modelId, chatId }: { modelId: string; chatId: string }) => {
fontSize={['sm', 'md']}
fontSize={['sm', 'md']}
onClick={() => router.push(`/model?modelId=${chatData.modelId}`)}
onClick={() => router.push(`/model?modelId=${chatData.modelId}`)}
>
>
{chatData.model.name} {ChatModelMap[chatData.chatModel].name}
{chatData.model.name} {ChatModelMap[chatData.chatModel]
?
.name}
{chatData.history.length > 0 ? ` (${chatData.history.length})` : ''}
{chatData.history.length > 0 ? ` (${chatData.history.length})` : ''}
</Box>
</Box>
{chatId ? (
{chatId ? (
...
...
client/src/pages/model/components/detail/components/ModelEditForm.tsx
View file @
ca4cd8af
...
@@ -175,7 +175,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
...
@@ -175,7 +175,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
// init kb select list
// init kb select list
const
{
data
:
kbList
=
[]
}
=
useQuery
([
'loadKbList'
],
()
=>
loadKbList
());
const
{
data
:
kbList
=
[]
}
=
useQuery
([
'loadKbList'
],
()
=>
loadKbList
());
const
RenderSelectedKbList
=
useCallback
(()
=>
{
const
RenderSelectedKbList
=
useCallback
(()
=>
{
const
kbs
=
getValues
(
'chat.relatedKbs'
)
.
map
((
id
)
=>
kbList
.
find
((
kb
)
=>
kb
.
_id
===
id
))
;
const
kbs
=
getValues
(
'chat.relatedKbs'
)
?.
map
((
id
)
=>
kbList
.
find
((
kb
)
=>
kb
.
_id
===
id
))
||
[]
;
return
(
return
(
<>
<>
...
@@ -334,7 +334,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
...
@@ -334,7 +334,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
</
Slider
>
</
Slider
>
</
Flex
>
</
Flex
>
</
FormControl
>
</
FormControl
>
{
getValues
(
'chat.relatedKbs'
).
length
>
0
&&
(
{
getValues
(
'chat.relatedKbs'
)
?
.
length
>
0
&&
(
<
Flex
mt=
{
4
}
alignItems=
{
'center'
}
>
<
Flex
mt=
{
4
}
alignItems=
{
'center'
}
>
<
Box
mr=
{
4
}
whiteSpace=
{
'nowrap'
}
>
<
Box
mr=
{
4
}
whiteSpace=
{
'nowrap'
}
>
搜索模式
 
搜索模式
 
...
@@ -583,7 +583,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
...
@@ -583,7 +583,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`;
{
kbList
.
map
((
item
)
=>
(
{
kbList
.
map
((
item
)
=>
(
<
Card
key=
{
item
.
_id
}
p=
{
3
}
mb=
{
3
}
>
<
Card
key=
{
item
.
_id
}
p=
{
3
}
mb=
{
3
}
>
<
Checkbox
<
Checkbox
isChecked=
{
getValues
(
'chat.relatedKbs'
).
includes
(
item
.
_id
)
}
isChecked=
{
getValues
(
'chat.relatedKbs'
)
?
.
includes
(
item
.
_id
)
}
onChange=
{
(
e
)
=>
{
onChange=
{
(
e
)
=>
{
const
ids
=
getValues
(
'chat.relatedKbs'
);
const
ids
=
getValues
(
'chat.relatedKbs'
);
// toggle to true
// toggle to true
...
...
client/src/pages/number/components/BillTable.tsx
View file @
ca4cd8af
...
@@ -23,7 +23,7 @@ const BillTable = () => {
...
@@ -23,7 +23,7 @@ const BillTable = () => {
return
(
return
(
<>
<>
<
TableContainer
position=
{
'relative'
}
minH=
{
'
2
00px'
}
>
<
TableContainer
position=
{
'relative'
}
minH=
{
'
1
00px'
}
>
<
Table
>
<
Table
>
<
Thead
>
<
Thead
>
<
Tr
>
<
Tr
>
...
@@ -53,7 +53,7 @@ const BillTable = () => {
...
@@ -53,7 +53,7 @@ const BillTable = () => {
</
TableContainer
>
</
TableContainer
>
{
!
isLoading
&&
bills
.
length
===
0
&&
(
{
!
isLoading
&&
bills
.
length
===
0
&&
(
<
Flex
h=
{
'100%'
}
flexDirection=
{
'column'
}
alignItems=
{
'center'
}
pt=
{
'200px'
}
>
<
Flex
h=
{
'100%'
}
flexDirection=
{
'column'
}
alignItems=
{
'center'
}
>
<
MyIcon
name=
"empty"
w=
{
'48px'
}
h=
{
'48px'
}
color=
{
'transparent'
}
/>
<
MyIcon
name=
"empty"
w=
{
'48px'
}
h=
{
'48px'
}
color=
{
'transparent'
}
/>
<
Box
mt=
{
2
}
color=
{
'myGray.500'
}
>
<
Box
mt=
{
2
}
color=
{
'myGray.500'
}
>
无使用记录~
无使用记录~
...
...
client/src/pages/number/components/InformTable.tsx
View file @
ca4cd8af
...
@@ -71,7 +71,7 @@ const BillTable = () => {
...
@@ -71,7 +71,7 @@ const BillTable = () => {
))
}
))
}
</
Accordion
>
</
Accordion
>
{
!
isLoading
&&
informs
.
length
===
0
&&
(
{
!
isLoading
&&
informs
.
length
===
0
&&
(
<
Flex
h=
{
'100%'
}
flexDirection=
{
'column'
}
alignItems=
{
'center'
}
pt=
{
'
2
00px'
}
>
<
Flex
h=
{
'100%'
}
flexDirection=
{
'column'
}
alignItems=
{
'center'
}
pt=
{
'
1
00px'
}
>
<
MyIcon
name=
"empty"
w=
{
'48px'
}
h=
{
'48px'
}
color=
{
'transparent'
}
/>
<
MyIcon
name=
"empty"
w=
{
'48px'
}
h=
{
'48px'
}
color=
{
'transparent'
}
/>
<
Box
mt=
{
2
}
color=
{
'myGray.500'
}
>
<
Box
mt=
{
2
}
color=
{
'myGray.500'
}
>
暂无通知~
暂无通知~
...
...
client/src/pages/number/components/PayRecordTable.tsx
View file @
ca4cd8af
...
@@ -92,7 +92,7 @@ const PayRecordTable = () => {
...
@@ -92,7 +92,7 @@ const PayRecordTable = () => {
</
Table
>
</
Table
>
</
TableContainer
>
</
TableContainer
>
{
!
isInitialLoading
&&
payOrders
.
length
===
0
&&
(
{
!
isInitialLoading
&&
payOrders
.
length
===
0
&&
(
<
Flex
h=
{
'100%'
}
flexDirection=
{
'column'
}
alignItems=
{
'center'
}
pt=
{
'
2
00px'
}
>
<
Flex
h=
{
'100%'
}
flexDirection=
{
'column'
}
alignItems=
{
'center'
}
pt=
{
'
1
00px'
}
>
<
MyIcon
name=
"empty"
w=
{
'48px'
}
h=
{
'48px'
}
color=
{
'transparent'
}
/>
<
MyIcon
name=
"empty"
w=
{
'48px'
}
h=
{
'48px'
}
color=
{
'transparent'
}
/>
<
Box
mt=
{
2
}
color=
{
'myGray.500'
}
>
<
Box
mt=
{
2
}
color=
{
'myGray.500'
}
>
无支付记录~
无支付记录~
...
...
client/src/pages/number/components/PromotionTable.tsx
View file @
ca4cd8af
...
@@ -23,7 +23,7 @@ const OpenApi = () => {
...
@@ -23,7 +23,7 @@ const OpenApi = () => {
return
(
return
(
<>
<>
<
TableContainer
position=
{
'relative'
}
overflow=
{
'hidden'
}
minH=
{
'
2
00px'
}
>
<
TableContainer
position=
{
'relative'
}
overflow=
{
'hidden'
}
minH=
{
'
1
00px'
}
>
<
Table
>
<
Table
>
<
Thead
>
<
Thead
>
<
Tr
>
<
Tr
>
...
...
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