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
aee5de29
authored
Sep 26, 2024
by
heheer
Committed by
GitHub
Sep 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: tool node fold (#2811)
* fix: tool node fold * delete console
parent
78d15c2a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
31 deletions
+42
-31
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/NodeTools.tsx
+0
-2
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/NodeCard.tsx
+42
-29
No files found.
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/NodeTools.tsx
View file @
aee5de29
...
@@ -34,8 +34,6 @@ const NodeTools = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
...
@@ -34,8 +34,6 @@ const NodeTools = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
text=
{
t
(
'common:core.workflow.tool.Select Tool'
)
}
text=
{
t
(
'common:core.workflow.tool.Select Tool'
)
}
/>
/>
</
Box
>
</
Box
>
<
ToolSourceHandle
/>
</
Box
>
</
Box
>
</
NodeCard
>
</
NodeCard
>
);
);
...
...
projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/nodes/render/NodeCard.tsx
View file @
aee5de29
...
@@ -9,7 +9,7 @@ import { useToast } from '@fastgpt/web/hooks/useToast';
...
@@ -9,7 +9,7 @@ import { useToast } from '@fastgpt/web/hooks/useToast';
import
{
FlowNodeTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
FlowNodeTypeEnum
}
from
'@fastgpt/global/core/workflow/node/constant'
;
import
{
useConfirm
}
from
'@fastgpt/web/hooks/useConfirm'
;
import
{
useConfirm
}
from
'@fastgpt/web/hooks/useConfirm'
;
import
{
LOGO_ICON
}
from
'@fastgpt/global/common/system/constants'
;
import
{
LOGO_ICON
}
from
'@fastgpt/global/common/system/constants'
;
import
{
ToolTargetHandle
}
from
'./Handle/ToolHandle'
;
import
{
Tool
SourceHandle
,
Tool
TargetHandle
}
from
'./Handle/ToolHandle'
;
import
{
useEditTextarea
}
from
'@fastgpt/web/hooks/useEditTextarea'
;
import
{
useEditTextarea
}
from
'@fastgpt/web/hooks/useEditTextarea'
;
import
{
ConnectionSourceHandle
,
ConnectionTargetHandle
}
from
'./Handle/ConnectionHandle'
;
import
{
ConnectionSourceHandle
,
ConnectionTargetHandle
}
from
'./Handle/ConnectionHandle'
;
import
{
useDebug
}
from
'../../hooks/useDebug'
;
import
{
useDebug
}
from
'../../hooks/useDebug'
;
...
@@ -165,31 +165,38 @@ const NodeCard = (props: Props) => {
...
@@ -165,31 +165,38 @@ const NodeCard = (props: Props) => {
{
/* avatar and name */
}
{
/* avatar and name */
}
<
Flex
alignItems=
{
'center'
}
>
<
Flex
alignItems=
{
'center'
}
>
<
Box
{
node
?.
flowNodeType
!==
FlowNodeTypeEnum
.
stopTool
&&
(
mr=
{
2
}
<
Box
cursor=
{
'pointer'
}
mr=
{
2
}
rounded=
{
'sm'
}
cursor=
{
'pointer'
}
_hover=
{
{
bg
:
'myGray.200'
}
}
rounded=
{
'sm'
}
onClick=
{
()
=>
{
_hover=
{
{
bg
:
'myGray.200'
}
}
onChangeNode
({
onClick=
{
()
=>
{
nodeId
,
onChangeNode
({
type
:
'attr'
,
nodeId
,
key
:
'isFolded'
,
type
:
'attr'
,
value
:
!
isFolded
key
:
'isFolded'
,
});
value
:
!
isFolded
}
}
});
>
}
}
{
!
isFolded
?
(
>
<
MyIcon
name=
{
'core/chat/chevronDown'
}
w=
{
'24px'
}
h=
{
'24px'
}
color=
{
'myGray.500'
}
/>
{
!
isFolded
?
(
)
:
(
<
MyIcon
<
MyIcon
name=
{
'core/chat/chevronDown'
}
name=
{
'core/chat/chevronRight'
}
w=
{
'24px'
}
w=
{
'24px'
}
h=
{
'24px'
}
h=
{
'24px'
}
color=
{
'myGray.500'
}
color=
{
'myGray.500'
}
/>
/>
)
:
(
)
}
<
MyIcon
</
Box
>
name=
{
'core/chat/chevronRight'
}
w=
{
'24px'
}
h=
{
'24px'
}
color=
{
'myGray.500'
}
/>
)
}
</
Box
>
)
}
<
Avatar
src=
{
avatar
}
borderRadius=
{
'sm'
}
objectFit=
{
'contain'
}
w=
{
'30px'
}
h=
{
'30px'
}
/>
<
Avatar
src=
{
avatar
}
borderRadius=
{
'sm'
}
objectFit=
{
'contain'
}
w=
{
'30px'
}
h=
{
'30px'
}
/>
<
Box
ml=
{
3
}
fontSize=
{
'md'
}
fontWeight=
{
'medium'
}
>
<
Box
ml=
{
3
}
fontSize=
{
'md'
}
fontWeight=
{
'medium'
}
>
{
t
(
name
as
any
)
}
{
t
(
name
as
any
)
}
...
@@ -272,6 +279,8 @@ const NodeCard = (props: Props) => {
...
@@ -272,6 +279,8 @@ const NodeCard = (props: Props) => {
},
[
},
[
showToolHandle
,
showToolHandle
,
nodeId
,
nodeId
,
node
?.
flowNodeType
,
isFolded
,
avatar
,
avatar
,
t
,
t
,
name
,
name
,
...
@@ -283,10 +292,9 @@ const NodeCard = (props: Props) => {
...
@@ -283,10 +292,9 @@ const NodeCard = (props: Props) => {
nodeList
,
nodeList
,
intro
,
intro
,
ConfirmSyncModal
,
ConfirmSyncModal
,
onOpenCustomTitleModal
,
onChangeNode
,
onChangeNode
,
toast
,
onOpenCustomTitleModal
,
isFolded
toast
]);
]);
const
RenderHandle
=
useMemo
(()
=>
{
const
RenderHandle
=
useMemo
(()
=>
{
return
(
return
(
...
@@ -296,6 +304,10 @@ const NodeCard = (props: Props) => {
...
@@ -296,6 +304,10 @@ const NodeCard = (props: Props) => {
</>
</>
);
);
},
[
nodeId
,
isFolded
]);
},
[
nodeId
,
isFolded
]);
const
RenderToolHandle
=
useMemo
(
()
=>
(
node
?.
flowNodeType
===
FlowNodeTypeEnum
.
tools
?
<
ToolSourceHandle
/>
:
null
),
[
node
?.
flowNodeType
]
);
return
(
return
(
<
Flex
<
Flex
...
@@ -337,6 +349,7 @@ const NodeCard = (props: Props) => {
...
@@ -337,6 +349,7 @@ const NodeCard = (props: Props) => {
{
Header
}
{
Header
}
{
!
isFolded
&&
children
}
{
!
isFolded
&&
children
}
{
RenderHandle
}
{
RenderHandle
}
{
RenderToolHandle
}
<
EditTitleModal
maxLength=
{
20
}
/>
<
EditTitleModal
maxLength=
{
20
}
/>
</
Flex
>
</
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