Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dify
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai-tech
dify
Commits
97530776
Commit
97530776
authored
Mar 12, 2024
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
22e7393b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
13 deletions
+23
-13
hooks.ts
web/app/components/workflow/hooks.ts
+6
-5
index.tsx
web/app/components/workflow/index.tsx
+9
-0
node-handle.tsx
...omponents/workflow/nodes/_base/components/node-handle.tsx
+2
-2
node.tsx
web/app/components/workflow/nodes/_base/node.tsx
+2
-2
node.tsx
web/app/components/workflow/nodes/if-else/node.tsx
+3
-3
node.tsx
...pp/components/workflow/nodes/question-classifier/node.tsx
+1
-1
No files found.
web/app/components/workflow/hooks.ts
View file @
97530776
...
...
@@ -340,11 +340,12 @@ export const useWorkflow = () => {
return
const
newNodes
=
produce
(
nodes
,
(
draft
)
=>
{
draft
.
forEach
(
node
=>
node
.
data
.
selected
=
false
)
const
selectedNode
=
draft
.
find
(
node
=>
node
.
id
===
nodeId
)
!
if
(
!
cancelSelection
&&
selectedNode
)
selectedNode
.
data
.
selected
=
true
draft
.
forEach
((
node
)
=>
{
if
(
node
.
id
===
nodeId
)
node
.
data
.
selected
=
!
cancelSelection
else
node
.
data
.
selected
=
false
})
})
setNodes
(
newNodes
)
handleSyncWorkflowDraft
()
...
...
web/app/components/workflow/index.tsx
View file @
97530776
...
...
@@ -5,6 +5,7 @@ import {
useMemo
,
}
from
'react'
import
useSWR
from
'swr'
import
{
setAutoFreeze
}
from
'immer'
import
{
useKeyPress
}
from
'ahooks'
import
ReactFlow
,
{
Background
,
...
...
@@ -65,6 +66,14 @@ const Workflow: FC<WorkflowProps> = memo(({
const
showFeaturesPanel
=
useStore
(
state
=>
state
.
showFeaturesPanel
)
const
runningStatus
=
useStore
(
s
=>
s
.
runningStatus
)
useEffect
(()
=>
{
setAutoFreeze
(
false
)
return
()
=>
{
setAutoFreeze
(
true
)
}
},
[])
const
{
handleSyncWorkflowDraft
,
...
...
web/app/components/workflow/nodes/_base/components/node-handle.tsx
View file @
97530776
...
...
@@ -50,7 +50,7 @@ export const NodeTargetHandle = ({
type=
'target'
position=
{
Position
.
Left
}
className=
{
`
!w-4 !h-4 !bg-transparent !rounded-none !outline-none !border-none
!translate-y-0
z-[1]
!w-4 !h-4 !bg-transparent !rounded-none !outline-none !border-none z-[1]
after:absolute after:w-0.5 after:h-2 after:left-1.5 after:top-1 after:bg-primary-500
${!connected && 'after:opacity-0'}
${data.type === BlockEnum.Start && 'opacity-0'}
...
...
@@ -111,7 +111,7 @@ export const NodeSourceHandle = ({
type=
'source'
position=
{
Position
.
Right
}
className=
{
`
!w-4 !h-4 !bg-transparent !rounded-none !outline-none !border-none
!translate-y-0
z-[1]
!w-4 !h-4 !bg-transparent !rounded-none !outline-none !border-none z-[1]
after:absolute after:w-0.5 after:h-2 after:right-1.5 after:top-1 after:bg-primary-500
${!connected && 'after:opacity-0'}
${handleClassName}
...
...
web/app/components/workflow/nodes/_base/node.tsx
View file @
97530776
...
...
@@ -54,7 +54,7 @@ const BaseNode: FC<BaseNodeProps> = ({
<
NodeTargetHandle
id=
{
id
}
data=
{
data
}
handleClassName=
'!top-4 !-left-[9px]'
handleClassName=
'!top-4 !-left-[9px]
!translate-y-0
'
handleId=
'target'
/>
)
...
...
@@ -64,7 +64,7 @@ const BaseNode: FC<BaseNodeProps> = ({
<
NodeSourceHandle
id=
{
id
}
data=
{
data
}
handleClassName=
'!top-4 !-right-[9px]'
handleClassName=
'!top-4 !-right-[9px]
!translate-y-0
'
handleId=
'source'
/>
)
...
...
web/app/components/workflow/nodes/if-else/node.tsx
View file @
97530776
...
...
@@ -9,7 +9,7 @@ import { Variable02 } from '@/app/components/base/icons/src/vender/solid/develop
const
i18nPrefix
=
'workflow.nodes.ifElse'
const
IfElseNode
:
FC
<
NodeProps
<
IfElseNodeType
>>
=
(
props
)
=>
{
const
{
id
,
data
}
=
props
const
{
data
}
=
props
const
{
t
}
=
useTranslation
()
const
{
conditions
,
logical_operator
}
=
data
...
...
@@ -20,7 +20,7 @@ const IfElseNode: FC<NodeProps<IfElseNodeType>> = (props) => {
<
NodeSourceHandle
{
...
props
}
handleId=
'true'
handleClassName=
'!top-1
!-right-[21px]
'
handleClassName=
'!top-1
/2 !-right-[21px] !-translate-y-1/2
'
/>
</
div
>
<
div
className=
'mb-0.5 leading-4 text-[10px] font-medium text-gray-500 uppercase'
>
{
t
(
`${i18nPrefix}.conditions`
)
}
</
div
>
...
...
@@ -44,7 +44,7 @@ const IfElseNode: FC<NodeProps<IfElseNodeType>> = (props) => {
<
NodeSourceHandle
{
...
props
}
handleId=
'false'
handleClassName=
'!top-1
!-right-[21px]
'
handleClassName=
'!top-1
/2 !-right-[21px] !-translate-y-1/2
'
/>
</
div
>
</
div
>
...
...
web/app/components/workflow/nodes/question-classifier/node.tsx
View file @
97530776
...
...
@@ -45,7 +45,7 @@ const Node: FC<NodeProps<QuestionClassifierNodeType>> = (props) => {
/>
<
NodeSourceHandle
{
...
props
}
handleId=
{
topic
.
name
}
handleId=
{
topic
.
id
}
handleClassName=
'!top-1/2 !-translate-y-1/2 !-right-[21px]'
/>
</
div
>
...
...
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