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
ace04b3e
Commit
ace04b3e
authored
Feb 18, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: filed and var
parent
1a4c2e77
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
106 additions
and
1 deletion
+106
-1
add-button.tsx
web/app/components/base/button/add-button.tsx
+22
-0
field.tsx
web/app/components/workflow/nodes/_base/components/field.tsx
+26
-0
node.tsx
web/app/components/workflow/nodes/llm/node.tsx
+23
-1
i18next-config.ts
web/i18n/i18next-config.ts
+6
-0
workflow.en.ts
web/i18n/lang/workflow.en.ts
+10
-0
workflow.pt.ts
web/i18n/lang/workflow.pt.ts
+9
-0
workflow.zh.ts
web/i18n/lang/workflow.zh.ts
+10
-0
No files found.
web/app/components/base/button/add-button.tsx
0 → 100644
View file @
ace04b3e
'use client'
import
type
{
FC
}
from
'react'
import
React
from
'react'
import
cn
from
'classnames'
import
{
Plus
}
from
'../icons/src/vender/line/general'
type
Props
=
{
className
?:
string
onClick
:
()
=>
void
}
const
AddButton
:
FC
<
Props
>
=
({
className
,
onClick
,
})
=>
{
return
(
<
div
className=
{
cn
(
className
,
'p-1 rounded-md cursor-pointer hover:bg-gray-200 select-none'
)
}
onClick=
{
onClick
}
>
<
Plus
className=
'w-4 h-4 text-gray-500'
/>
</
div
>
)
}
export
default
React
.
memo
(
AddButton
)
web/app/components/workflow/nodes/_base/components/field.tsx
0 → 100644
View file @
ace04b3e
'use client'
import
type
{
FC
}
from
'react'
import
React
from
'react'
type
Props
=
{
title
:
string
children
:
JSX
.
Element
|
string
operations
?:
JSX
.
Element
}
const
Filed
:
FC
<
Props
>
=
({
title
,
children
,
operations
,
})
=>
{
return
(
<
div
>
<
div
className=
'flex justify-between items-center'
>
<
div
className=
'leading-[18px] text-xs font-medium text-gray-500 uppercase'
>
{
title
}
</
div
>
{
operations
&&
<
div
>
{
operations
}
</
div
>
}
</
div
>
<
div
>
{
children
}
</
div
>
</
div
>
)
}
export
default
React
.
memo
(
Filed
)
web/app/components/workflow/nodes/llm/node.tsx
View file @
ace04b3e
import
type
{
FC
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
BaseNode
from
'../_base/node'
import
Field
from
'@/app/components/workflow/nodes/_base/components/field'
import
AddButton
from
'@/app/components/base/button/add-button'
const
i18nPrefix
=
'workflow.nodes.llm'
const
Node
:
FC
=
()
=>
{
const
{
t
}
=
useTranslation
()
const
handleAddVariable
=
()
=>
{
console
.
log
(
'add variable'
)
}
return
(
<
BaseNode
>
<
div
>
llm
</
div
>
<
div
>
<
Field
title=
{
t
(
`${i18nPrefix}.model`
)
}
>
Model Selector
</
Field
>
<
Field
title=
{
t
(
`${i18nPrefix}.variables`
)
}
operations=
{
<
AddButton
onClick=
{
handleAddVariable
}
/>
}
>
Var Selector
</
Field
>
</
div
>
</
BaseNode
>
)
}
...
...
web/i18n/i18next-config.ts
View file @
ace04b3e
...
...
@@ -61,6 +61,9 @@ import customPt from './lang/custom.pt' // Portuguese import
import
toolsEn
from
'./lang/tools.en'
import
toolsZh
from
'./lang/tools.zh'
import
toolsPt
from
'./lang/tools.pt'
// Portuguese import
import
workflowEn
from
'./lang/workflow.en'
import
workflowZh
from
'./lang/workflow.zh'
import
workflowPt
from
'./lang/workflow.pt'
// Portuguese import
const
resources
=
{
'en-US'
:
{
...
...
@@ -89,6 +92,7 @@ const resources = {
custom
:
customEn
,
// tools
tools
:
toolsEn
,
workflow
:
workflowEn
,
},
},
'zh-Hans'
:
{
...
...
@@ -116,6 +120,7 @@ const resources = {
custom
:
customZh
,
// tools
tools
:
toolsZh
,
workflow
:
workflowZh
,
},
},
'pt-BR'
:
{
...
...
@@ -142,6 +147,7 @@ const resources = {
billing
:
billingPt
,
custom
:
customPt
,
tools
:
toolsPt
,
workflow
:
workflowPt
,
},
},
}
...
...
web/i18n/lang/workflow.en.ts
0 → 100644
View file @
ace04b3e
const
translation
=
{
nodes
:
{
llm
:
{
model
:
'model'
,
variables
:
'variables'
,
},
},
}
export
default
translation
web/i18n/lang/workflow.pt.ts
0 → 100644
View file @
ace04b3e
const
translation
=
{
nodes
:
{
llm
:
{
model
:
'model'
,
},
},
}
export
default
translation
web/i18n/lang/workflow.zh.ts
0 → 100644
View file @
ace04b3e
const
translation
=
{
nodes
:
{
llm
:
{
model
:
'模型'
,
variables
:
'变量'
,
},
},
}
export
default
translation
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