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
834d3698
authored
Jul 31, 2024
by
Archer
Committed by
GitHub
Jul 31, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: response modal (#2228)
parent
2fdca621
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
68 deletions
+62
-68
projects/app/src/components/core/chat/components/WholeResponseModal.tsx
+60
-64
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/NodeCard.tsx
+2
-4
No files found.
projects/app/src/components/core/chat/components/WholeResponseModal.tsx
View file @
834d3698
...
@@ -170,81 +170,77 @@ export const ResponseBox = React.memo(function ResponseBox({
...
@@ -170,81 +170,77 @@ export const ResponseBox = React.memo(function ResponseBox({
</
Box
>
</
Box
>
</
Flex
>
</
Flex
>
)
:
(
)
:
(
<>
<
Box
h=
{
'100%'
}
overflow=
{
'auto'
}
>
<
Box
position=
{
'relative'
}
overflow=
{
isOpenMobileModal
?
'hidden'
:
''
}
>
{
!
isOpenMobileModal
&&
(
{
!
isOpenMobileModal
&&
(
<
WholeResponseSideTab
<
Box
height=
{
'100%'
}
>
response=
{
sideResponse
}
<
WholeResponseSideTab
value=
{
currentNodeId
}
response=
{
sideResponse
}
onChange=
{
(
item
:
string
)
=>
{
value=
{
currentNodeId
}
setCurrentNodeId
(
item
);
onChange=
{
(
item
:
string
)
=>
{
onOpenMobileModal
();
setCurrentNodeId
(
item
);
}
}
onOpenMobileModal
();
isMobile=
{
true
}
/>
)
}
{
isOpenMobileModal
&&
(
<
Flex
flexDirection=
{
'column'
}
h=
{
'100%'
}
>
<
Flex
align=
{
'center'
}
justifyContent=
{
'center'
}
px=
{
2
}
py=
{
2
}
borderBottom=
{
'sm'
}
position=
{
'relative'
}
height=
{
'40px'
}
>
<
MyIcon
width=
{
4
}
height=
{
4
}
name=
"common/backLight"
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
onCloseMobileModal
();
}
}
}
}
isMobile=
{
true
}
position=
{
'absolute'
}
left=
{
2
}
top=
{
'50%'
}
transform=
{
'translateY(-50%)'
}
cursor=
{
'pointer'
}
_hover=
{
{
color
:
'primary.500'
}
}
/>
/>
</
Box
>
)
}
{
isOpenMobileModal
&&
(
<
Box
h=
{
'100%'
}
w=
{
'100%'
}
zIndex=
{
10
}
background=
{
'white'
}
>
<
Flex
align=
{
'center'
}
justifyContent=
{
'center'
}
px=
{
2
}
py=
{
2
}
borderBottom=
{
'sm'
}
position=
{
'relative'
}
height=
{
'40px'
}
>
<
MyIcon
width=
{
4
}
height=
{
4
}
name=
"common/backLight"
onClick=
{
(
e
)
=>
{
e
.
stopPropagation
();
onCloseMobileModal
();
}
}
position=
{
'absolute'
}
left=
{
2
}
top=
{
'50%'
}
transform=
{
'translateY(-50%)'
}
cursor=
{
'pointer'
}
_hover=
{
{
color
:
'primary.500'
}
}
/>
<
Avatar
<
Avatar
src=
{
src=
{
activeModule
.
moduleLogo
||
activeModule
.
moduleLogo
||
moduleTemplatesFlat
.
find
(
moduleTemplatesFlat
.
find
(
(
template
)
=>
activeModule
.
moduleType
===
template
.
flowNodeType
(
template
)
=>
activeModule
.
moduleType
===
template
.
flowNodeType
)?.
avatar
)?.
avatar
}
}
w=
{
'1.25rem'
}
w=
{
'1.25rem'
}
h=
{
'1.25rem'
}
h=
{
'1.25rem'
}
borderRadius=
{
'sm'
}
borderRadius=
{
'sm'
}
/>
/>
<
Box
ml=
{
1.5
}
lineHeight=
{
'1.25rem'
}
alignItems=
{
'center'
}
>
<
Box
ml=
{
1.5
}
lineHeight=
{
'1.25rem'
}
alignItems=
{
'center'
}
>
{
t
(
activeModule
.
moduleName
as
any
)
}
{
t
(
activeModule
.
moduleName
as
any
)
}
</
Box
>
</
Flex
>
<
Box
overflow=
{
'auto'
}
height=
{
'calc(100% - 40px)'
}
>
<
WholeResponseContent
activeModule=
{
activeModule
}
hideTabs=
{
hideTabs
}
showDetail=
{
showDetail
}
/>
</
Box
>
</
Box
>
</
Flex
>
<
Box
flex=
{
'1 0 0'
}
overflow=
{
'auto'
}
>
<
WholeResponseContent
activeModule=
{
activeModule
}
hideTabs=
{
hideTabs
}
showDetail=
{
showDetail
}
/>
</
Box
>
</
Box
>
)
}
</
Flex
>
</
Box
>
)
}
</>
</
Box
>
)
}
)
}
</>
</>
);
);
});
});
const
WholeResponseContent
=
({
export
const
WholeResponseContent
=
({
activeModule
,
activeModule
,
hideTabs
,
hideTabs
,
showDetail
showDetail
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/NodeCard.tsx
View file @
834d3698
...
@@ -25,7 +25,7 @@ import { QuestionOutlineIcon } from '@chakra-ui/icons';
...
@@ -25,7 +25,7 @@ import { QuestionOutlineIcon } from '@chakra-ui/icons';
import
MyTooltip
from
'@fastgpt/web/components/common/MyTooltip'
;
import
MyTooltip
from
'@fastgpt/web/components/common/MyTooltip'
;
import
{
useRequest2
}
from
'@fastgpt/web/hooks/useRequest'
;
import
{
useRequest2
}
from
'@fastgpt/web/hooks/useRequest'
;
import
{
useWorkflowUtils
}
from
'../../hooks/useUtils'
;
import
{
useWorkflowUtils
}
from
'../../hooks/useUtils'
;
import
{
ResponseBox
}
from
'@/components/core/chat/components/WholeResponseModal'
;
import
{
WholeResponseContent
}
from
'@/components/core/chat/components/WholeResponseModal'
;
type
Props
=
FlowNodeItemType
&
{
type
Props
=
FlowNodeItemType
&
{
children
?:
React
.
ReactNode
|
React
.
ReactNode
[]
|
string
;
children
?:
React
.
ReactNode
|
React
.
ReactNode
[]
|
string
;
...
@@ -623,9 +623,7 @@ const NodeDebugResponse = React.memo(function NodeDebugResponse({
...
@@ -623,9 +623,7 @@ const NodeDebugResponse = React.memo(function NodeDebugResponse({
{
debugResult
.
message
}
{
debugResult
.
message
}
</
Box
>
</
Box
>
)
}
)
}
{
response
&&
(
{
response
&&
<
WholeResponseContent
activeModule=
{
response
}
showDetail
/>
}
<
ResponseBox
useMobile=
{
true
}
response=
{
[
response
]
}
showDetail
hideTabs
/>
)
}
</
Box
>
</
Box
>
</
Card
>
</
Card
>
)
}
)
}
...
...
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