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
ede0bb53
Commit
ede0bb53
authored
Mar 05, 2024
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
control run
parent
186b85cd
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
37 additions
and
26 deletions
+37
-26
panel.tsx
web/app/components/workflow/nodes/_base/panel.tsx
+7
-2
panel.tsx
web/app/components/workflow/nodes/code/panel.tsx
+2
-2
panel.tsx
web/app/components/workflow/nodes/direct-answer/panel.tsx
+2
-2
panel.tsx
web/app/components/workflow/nodes/end/panel.tsx
+2
-2
panel.tsx
web/app/components/workflow/nodes/http/panel.tsx
+2
-2
panel.tsx
web/app/components/workflow/nodes/if-else/panel.tsx
+2
-2
panel.tsx
...p/components/workflow/nodes/knowledge-retrieval/panel.tsx
+2
-2
panel.tsx
web/app/components/workflow/nodes/llm/panel.tsx
+2
-2
panel.tsx
...p/components/workflow/nodes/question-classifier/panel.tsx
+2
-2
panel.tsx
web/app/components/workflow/nodes/start/panel.tsx
+2
-2
panel.tsx
...pp/components/workflow/nodes/template-transform/panel.tsx
+2
-2
panel.tsx
web/app/components/workflow/nodes/tool/panel.tsx
+2
-2
panel.tsx
...app/components/workflow/nodes/variable-assigner/panel.tsx
+2
-2
types.ts
web/app/components/workflow/types.ts
+6
-0
No files found.
web/app/components/workflow/nodes/_base/panel.tsx
View file @
ede0bb53
...
@@ -6,6 +6,7 @@ import {
...
@@ -6,6 +6,7 @@ import {
cloneElement
,
cloneElement
,
memo
,
memo
,
useCallback
,
useCallback
,
useState
,
}
from
'react'
}
from
'react'
import
{
type
Node
}
from
'../../types'
import
{
type
Node
}
from
'../../types'
import
{
BlockEnum
}
from
'../../types'
import
{
BlockEnum
}
from
'../../types'
...
@@ -38,6 +39,7 @@ const BasePanel: FC<BasePanelProps> = ({
...
@@ -38,6 +39,7 @@ const BasePanel: FC<BasePanelProps> = ({
handleNodeSelect
,
handleNodeSelect
,
handleNodeDataUpdate
,
handleNodeDataUpdate
,
}
=
useWorkflow
()
}
=
useWorkflow
()
const
[
controlSingleRun
,
setControlSingleRun
]
=
useState
(
0
)
const
handleTitleChange
=
useCallback
((
title
:
string
)
=>
{
const
handleTitleChange
=
useCallback
((
title
:
string
)
=>
{
handleNodeDataUpdate
({
id
,
data
:
{
...
data
,
title
}
})
handleNodeDataUpdate
({
id
,
data
:
{
...
data
,
title
}
})
},
[
handleNodeDataUpdate
,
id
,
data
])
},
[
handleNodeDataUpdate
,
id
,
data
])
...
@@ -64,7 +66,10 @@ const BasePanel: FC<BasePanelProps> = ({
...
@@ -64,7 +66,10 @@ const BasePanel: FC<BasePanelProps> = ({
<
TooltipPlus
<
TooltipPlus
popupContent=
'Run this step'
popupContent=
'Run this step'
>
>
<
div
className=
'flex items-center justify-center mr-1 w-6 h-6 rounded-md hover:bg-black/5 cursor-pointer'
>
<
div
className=
'flex items-center justify-center mr-1 w-6 h-6 rounded-md hover:bg-black/5 cursor-pointer'
onClick=
{
()
=>
!
controlSingleRun
&&
setControlSingleRun
(
Date
.
now
())
}
>
<
Play
className=
'w-4 h-4 text-gray-500'
/>
<
Play
className=
'w-4 h-4 text-gray-500'
/>
</
div
>
</
div
>
</
TooltipPlus
>
</
TooltipPlus
>
...
@@ -88,7 +93,7 @@ const BasePanel: FC<BasePanelProps> = ({
...
@@ -88,7 +93,7 @@ const BasePanel: FC<BasePanelProps> = ({
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
'py-2'
>
<
div
className=
'py-2'
>
{
cloneElement
(
children
,
{
id
,
data
})
}
{
cloneElement
(
children
,
{
id
,
data
,
controlSingleRun
,
setControlSingleRun
})
}
</
div
>
</
div
>
{
{
data
.
type
!==
BlockEnum
.
End
&&
(
data
.
type
!==
BlockEnum
.
End
&&
(
...
...
web/app/components/workflow/nodes/code/panel.tsx
View file @
ede0bb53
...
@@ -11,7 +11,7 @@ import Field from '@/app/components/workflow/nodes/_base/components/field'
...
@@ -11,7 +11,7 @@ import Field from '@/app/components/workflow/nodes/_base/components/field'
import
Split
from
'@/app/components/workflow/nodes/_base/components/split'
import
Split
from
'@/app/components/workflow/nodes/_base/components/split'
import
CodeEditor
from
'@/app/components/workflow/nodes/_base/components/editor/code-editor'
import
CodeEditor
from
'@/app/components/workflow/nodes/_base/components/editor/code-editor'
import
TypeSelector
from
'@/app/components/workflow/nodes/_base/components/selector'
import
TypeSelector
from
'@/app/components/workflow/nodes/_base/components/selector'
import
type
{
NodeProps
}
from
'@/app/components/workflow/types'
import
type
{
NodeP
anelP
rops
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.code'
const
i18nPrefix
=
'workflow.nodes.code'
...
@@ -25,7 +25,7 @@ const codeLanguages = [
...
@@ -25,7 +25,7 @@ const codeLanguages = [
value
:
CodeLanguage
.
javascript
,
value
:
CodeLanguage
.
javascript
,
},
},
]
]
const
Panel
:
FC
<
NodeProps
<
CodeNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
CodeNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/nodes/direct-answer/panel.tsx
View file @
ede0bb53
...
@@ -8,11 +8,11 @@ import Field from '@/app/components/workflow/nodes/_base/components/field'
...
@@ -8,11 +8,11 @@ import Field from '@/app/components/workflow/nodes/_base/components/field'
import
AddButton
from
'@/app/components/base/button/add-button'
import
AddButton
from
'@/app/components/base/button/add-button'
import
Split
from
'@/app/components/workflow/nodes/_base/components/split'
import
Split
from
'@/app/components/workflow/nodes/_base/components/split'
import
Editor
from
'@/app/components/workflow/nodes/_base/components/prompt/editor'
import
Editor
from
'@/app/components/workflow/nodes/_base/components/prompt/editor'
import
type
{
NodeProps
}
from
'@/app/components/workflow/types'
import
type
{
NodeP
anelP
rops
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.directAnswer'
const
i18nPrefix
=
'workflow.nodes.directAnswer'
const
Panel
:
FC
<
NodeProps
<
DirectAnswerNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
DirectAnswerNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/nodes/end/panel.tsx
View file @
ede0bb53
...
@@ -9,7 +9,7 @@ import { EndVarType } from './types'
...
@@ -9,7 +9,7 @@ import { EndVarType } from './types'
import
VarList
from
'@/app/components/workflow/nodes/_base/components/variable/var-list'
import
VarList
from
'@/app/components/workflow/nodes/_base/components/variable/var-list'
import
Field
from
'@/app/components/workflow/nodes/_base/components/field'
import
Field
from
'@/app/components/workflow/nodes/_base/components/field'
import
AddButton
from
'@/app/components/base/button/add-button'
import
AddButton
from
'@/app/components/base/button/add-button'
import
type
{
NodeProps
}
from
'@/app/components/workflow/types'
import
type
{
NodeP
anelP
rops
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.end'
const
i18nPrefix
=
'workflow.nodes.end'
...
@@ -36,7 +36,7 @@ const TypeItem = ({ type, current, onClick }: { type: EndVarType; current: EndVa
...
@@ -36,7 +36,7 @@ const TypeItem = ({ type, current, onClick }: { type: EndVarType; current: EndVa
const
allTypes
=
[
EndVarType
.
plainText
,
EndVarType
.
structured
,
EndVarType
.
none
]
const
allTypes
=
[
EndVarType
.
plainText
,
EndVarType
.
structured
,
EndVarType
.
none
]
const
Panel
:
FC
<
NodeProps
<
EndNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
EndNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/nodes/http/panel.tsx
View file @
ede0bb53
...
@@ -13,10 +13,10 @@ import AddButton from '@/app/components/base/button/add-button'
...
@@ -13,10 +13,10 @@ import AddButton from '@/app/components/base/button/add-button'
import
Split
from
'@/app/components/workflow/nodes/_base/components/split'
import
Split
from
'@/app/components/workflow/nodes/_base/components/split'
import
OutputVars
,
{
VarItem
}
from
'@/app/components/workflow/nodes/_base/components/output-vars'
import
OutputVars
,
{
VarItem
}
from
'@/app/components/workflow/nodes/_base/components/output-vars'
import
{
Settings01
}
from
'@/app/components/base/icons/src/vender/line/general'
import
{
Settings01
}
from
'@/app/components/base/icons/src/vender/line/general'
import
type
{
NodeProps
}
from
'@/app/components/workflow/types'
import
type
{
NodeP
anelP
rops
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.http'
const
i18nPrefix
=
'workflow.nodes.http'
const
Panel
:
FC
<
NodeProps
<
HttpNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
HttpNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/nodes/if-else/panel.tsx
View file @
ede0bb53
...
@@ -7,10 +7,10 @@ import useConfig from './use-config'
...
@@ -7,10 +7,10 @@ import useConfig from './use-config'
import
ConditionList
from
'./components/condition-list'
import
ConditionList
from
'./components/condition-list'
import
type
{
IfElseNodeType
}
from
'./types'
import
type
{
IfElseNodeType
}
from
'./types'
import
Field
from
'@/app/components/workflow/nodes/_base/components/field'
import
Field
from
'@/app/components/workflow/nodes/_base/components/field'
import
type
{
NodeProps
}
from
'@/app/components/workflow/types'
import
type
{
NodeP
anelP
rops
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.ifElse'
const
i18nPrefix
=
'workflow.nodes.ifElse'
const
Panel
:
FC
<
NodeProps
<
IfElseNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
IfElseNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/nodes/knowledge-retrieval/panel.tsx
View file @
ede0bb53
...
@@ -10,11 +10,11 @@ import type { KnowledgeRetrievalNodeType } from './types'
...
@@ -10,11 +10,11 @@ import type { KnowledgeRetrievalNodeType } from './types'
import
Field
from
'@/app/components/workflow/nodes/_base/components/field'
import
Field
from
'@/app/components/workflow/nodes/_base/components/field'
import
Split
from
'@/app/components/workflow/nodes/_base/components/split'
import
Split
from
'@/app/components/workflow/nodes/_base/components/split'
import
OutputVars
,
{
VarItem
}
from
'@/app/components/workflow/nodes/_base/components/output-vars'
import
OutputVars
,
{
VarItem
}
from
'@/app/components/workflow/nodes/_base/components/output-vars'
import
type
{
NodeProps
}
from
'@/app/components/workflow/types'
import
type
{
NodeP
anelP
rops
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.knowledgeRetrieval'
const
i18nPrefix
=
'workflow.nodes.knowledgeRetrieval'
const
Panel
:
FC
<
NodeProps
<
KnowledgeRetrievalNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
KnowledgeRetrievalNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/nodes/llm/panel.tsx
View file @
ede0bb53
...
@@ -12,12 +12,12 @@ import AddButton from '@/app/components/base/button/add-button'
...
@@ -12,12 +12,12 @@ import AddButton from '@/app/components/base/button/add-button'
import
Split
from
'@/app/components/workflow/nodes/_base/components/split'
import
Split
from
'@/app/components/workflow/nodes/_base/components/split'
import
ModelParameterModal
from
'@/app/components/header/account-setting/model-provider-page/model-parameter-modal'
import
ModelParameterModal
from
'@/app/components/header/account-setting/model-provider-page/model-parameter-modal'
import
OutputVars
,
{
VarItem
}
from
'@/app/components/workflow/nodes/_base/components/output-vars'
import
OutputVars
,
{
VarItem
}
from
'@/app/components/workflow/nodes/_base/components/output-vars'
import
type
{
NodeProps
}
from
'@/app/components/workflow/types'
import
{
Resolution
}
from
'@/types/app'
import
{
Resolution
}
from
'@/types/app'
import
type
{
NodePanelProps
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.llm'
const
i18nPrefix
=
'workflow.nodes.llm'
const
Panel
:
FC
<
NodeProps
<
LLMNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
LLMNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/nodes/question-classifier/panel.tsx
View file @
ede0bb53
...
@@ -8,11 +8,11 @@ import AdvancedSetting from './components/advanced-setting'
...
@@ -8,11 +8,11 @@ import AdvancedSetting from './components/advanced-setting'
import
type
{
QuestionClassifierNodeType
}
from
'./types'
import
type
{
QuestionClassifierNodeType
}
from
'./types'
import
Field
from
'@/app/components/workflow/nodes/_base/components/field'
import
Field
from
'@/app/components/workflow/nodes/_base/components/field'
import
ModelParameterModal
from
'@/app/components/header/account-setting/model-provider-page/model-parameter-modal'
import
ModelParameterModal
from
'@/app/components/header/account-setting/model-provider-page/model-parameter-modal'
import
type
{
NodeProps
}
from
'@/app/components/workflow/types'
import
type
{
NodeP
anelP
rops
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.questionClassifiers'
const
i18nPrefix
=
'workflow.nodes.questionClassifiers'
const
Panel
:
FC
<
NodeProps
<
QuestionClassifierNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
QuestionClassifierNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/nodes/start/panel.tsx
View file @
ede0bb53
...
@@ -9,11 +9,11 @@ import Field from '@/app/components/workflow/nodes/_base/components/field'
...
@@ -9,11 +9,11 @@ import Field from '@/app/components/workflow/nodes/_base/components/field'
import
OutputVars
,
{
VarItem
}
from
'@/app/components/workflow/nodes/_base/components/output-vars'
import
OutputVars
,
{
VarItem
}
from
'@/app/components/workflow/nodes/_base/components/output-vars'
import
AddButton
from
'@/app/components/base/button/add-button'
import
AddButton
from
'@/app/components/base/button/add-button'
import
ConfigVarModal
from
'@/app/components/app/configuration/config-var/config-modal'
import
ConfigVarModal
from
'@/app/components/app/configuration/config-var/config-modal'
import
type
{
InputVar
,
NodeProps
}
from
'@/app/components/workflow/types'
import
type
{
InputVar
,
NodeP
anelP
rops
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.start'
const
i18nPrefix
=
'workflow.nodes.start'
const
Panel
:
FC
<
NodeProps
<
StartNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
StartNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/nodes/template-transform/panel.tsx
View file @
ede0bb53
...
@@ -10,11 +10,11 @@ import Split from '@/app/components/workflow/nodes/_base/components/split'
...
@@ -10,11 +10,11 @@ import Split from '@/app/components/workflow/nodes/_base/components/split'
import
CodeEditor
from
'@/app/components/workflow/nodes/_base/components/editor/code-editor'
import
CodeEditor
from
'@/app/components/workflow/nodes/_base/components/editor/code-editor'
import
OutputVars
,
{
VarItem
}
from
'@/app/components/workflow/nodes/_base/components/output-vars'
import
OutputVars
,
{
VarItem
}
from
'@/app/components/workflow/nodes/_base/components/output-vars'
import
{
HelpCircle
}
from
'@/app/components/base/icons/src/vender/line/general'
import
{
HelpCircle
}
from
'@/app/components/base/icons/src/vender/line/general'
import
type
{
NodeProps
}
from
'@/app/components/workflow/types'
import
type
{
NodeP
anelP
rops
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.templateTransform'
const
i18nPrefix
=
'workflow.nodes.templateTransform'
const
Panel
:
FC
<
NodeProps
<
TemplateTransformNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
TemplateTransformNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/nodes/tool/panel.tsx
View file @
ede0bb53
...
@@ -5,11 +5,11 @@ import Split from '../_base/components/split'
...
@@ -5,11 +5,11 @@ import Split from '../_base/components/split'
import
type
{
ToolNodeType
}
from
'./types'
import
type
{
ToolNodeType
}
from
'./types'
import
Button
from
'@/app/components/base/button'
import
Button
from
'@/app/components/base/button'
import
Field
from
'@/app/components/workflow/nodes/_base/components/field'
import
Field
from
'@/app/components/workflow/nodes/_base/components/field'
import
type
{
NodeProps
}
from
'@/app/components/workflow/types'
import
type
{
NodeP
anelP
rops
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.tool'
const
i18nPrefix
=
'workflow.nodes.tool'
const
Panel
:
FC
<
NodeProps
<
ToolNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
ToolNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/nodes/variable-assigner/panel.tsx
View file @
ede0bb53
...
@@ -8,10 +8,10 @@ import Field from '@/app/components/workflow/nodes/_base/components/field'
...
@@ -8,10 +8,10 @@ import Field from '@/app/components/workflow/nodes/_base/components/field'
import
Selector
from
'@/app/components/workflow/nodes/_base/components/selector'
import
Selector
from
'@/app/components/workflow/nodes/_base/components/selector'
import
AddButton
from
'@/app/components/base/button/add-button'
import
AddButton
from
'@/app/components/base/button/add-button'
import
{
ChevronDown
}
from
'@/app/components/base/icons/src/vender/line/arrows'
import
{
ChevronDown
}
from
'@/app/components/base/icons/src/vender/line/arrows'
import
type
{
NodeProps
}
from
'@/app/components/workflow/types'
import
type
{
NodeP
anelP
rops
}
from
'@/app/components/workflow/types'
const
i18nPrefix
=
'workflow.nodes.variableAssigner'
const
i18nPrefix
=
'workflow.nodes.variableAssigner'
const
Panel
:
FC
<
NodeProps
<
VariableAssignerNodeType
>>
=
({
const
Panel
:
FC
<
NodeP
anelP
rops
<
VariableAssignerNodeType
>>
=
({
id
,
id
,
data
,
data
,
})
=>
{
})
=>
{
...
...
web/app/components/workflow/types.ts
View file @
ede0bb53
...
@@ -40,6 +40,12 @@ export type CommonEdgeType = {
...
@@ -40,6 +40,12 @@ export type CommonEdgeType = {
export
type
Node
=
ReactFlowNode
<
CommonNodeType
>
export
type
Node
=
ReactFlowNode
<
CommonNodeType
>
export
type
SelectedNode
=
Pick
<
Node
,
'id'
|
'data'
>
export
type
SelectedNode
=
Pick
<
Node
,
'id'
|
'data'
>
export
type
NodeProps
<
T
>
=
{
id
:
string
;
data
:
CommonNodeType
<
T
>
}
export
type
NodeProps
<
T
>
=
{
id
:
string
;
data
:
CommonNodeType
<
T
>
}
export
type
NodePanelProps
<
T
>
=
{
id
:
string
data
:
CommonNodeType
<
T
>
controlSingleRun
:
boolean
setControlSingleRun
:
(
value
:
boolean
)
=>
void
}
export
type
Edge
=
ReactFlowEdge
<
CommonEdgeType
>
export
type
Edge
=
ReactFlowEdge
<
CommonEdgeType
>
export
type
ValueSelector
=
string
[]
// [nodeId, key | obj key path]
export
type
ValueSelector
=
string
[]
// [nodeId, key | obj key path]
...
...
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