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
2fdcf175
Commit
2fdcf175
authored
Feb 22, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: end node
parent
f489736e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
4 deletions
+35
-4
page.tsx
web/app/(commonLayout)/workflow/nodes/page.tsx
+2
-2
mock.ts
web/app/components/workflow/nodes/end/mock.ts
+1
-1
node.tsx
web/app/components/workflow/nodes/end/node.tsx
+16
-1
workflow.en.ts
web/i18n/lang/workflow.en.ts
+8
-0
workflow.zh.ts
web/i18n/lang/workflow.zh.ts
+8
-0
No files found.
web/app/(commonLayout)/workflow/nodes/page.tsx
View file @
2fdcf175
...
...
@@ -7,11 +7,11 @@ import { BlockEnum } from '@/app/components/workflow/types'
const
nodes
=
[
BlockEnum
.
Start
,
BlockEnum
.
DirectAnswer
,
BlockEnum
.
LLM
,
BlockEnum
.
KnowledgeRetrieval
,
BlockEnum
.
QuestionClassifier
,
BlockEnum
.
IfElse
,
BlockEnum
.
Code
,
BlockEnum
.
TemplateTransform
,
BlockEnum
.
HttpRequest
,
BlockEnum
.
Tool
,
BlockEnum
.
Tool
,
BlockEnum
.
End
,
].
map
((
item
,
i
)
=>
({
id
:
`
${
i
+
1
}
`
,
type
:
'custom'
,
position
:
{
x
:
330
,
y
:
30
+
i
*
2
00
},
position
:
{
x
:
330
,
y
:
30
+
i
*
3
00
},
data
:
{
type
:
item
,
name
:
item
},
}))
const
initialNodes
=
nodes
...
...
web/app/components/workflow/nodes/end/mock.ts
View file @
2fdcf175
...
...
@@ -6,7 +6,7 @@ export const mockData: EndNodeType = {
desc
:
'Test'
,
type
:
'Test'
,
outputs
:
{
type
:
EndVarType
.
none
,
type
:
EndVarType
.
plainText
,
plain_text_selector
:
[
'test'
],
structured_variables
:
[
{
...
...
web/app/components/workflow/nodes/end/node.tsx
View file @
2fdcf175
import
type
{
FC
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
{
mockData
}
from
'./mock'
const
i18nPrefix
=
'workflow.nodes.end'
const
Node
:
FC
=
()
=>
{
const
{
t
}
=
useTranslation
()
const
{
outputs
}
=
mockData
return
(
<
div
>
end
</
div
>
<
div
className=
'px-3'
>
<
div
className=
'flex items-center h-6 justify-between bg-gray-100 rounded-md px-1 space-x-1 text-xs font-normal text-gray-700'
>
<
div
className=
'text-xs font-medium text-gray-500 uppercase'
>
{
t
(
`${i18nPrefix}.outputs`
)
}
</
div
>
<
div
className=
'text-xs font-normal text-gray-700'
>
{
t
(
`${i18nPrefix}.type.${outputs.type}`
)
}
</
div
>
</
div
>
</
div
>
)
}
...
...
web/i18n/lang/workflow.en.ts
View file @
2fdcf175
...
...
@@ -7,6 +7,14 @@ const translation = {
start
:
{
required
:
'required'
,
},
end
:
{
outputs
:
'Outputs'
,
type
:
{
'none'
:
'None'
,
'plain-text'
:
'Plain Text'
,
'structured'
:
'Structured'
,
},
},
directAnswer
:
{
answer
:
'Answer'
,
inputVars
:
'Input Variables'
,
...
...
web/i18n/lang/workflow.zh.ts
View file @
2fdcf175
...
...
@@ -7,6 +7,14 @@ const translation = {
start
:
{
required
:
'必填'
,
},
end
:
{
outputs
:
'输出'
,
type
:
{
'none'
:
'无'
,
'plain-text'
:
'纯文本'
,
'structured'
:
'结构化'
,
},
},
directAnswer
:
{
answer
:
'回复'
,
inputVars
:
'输入变量'
,
...
...
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