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
b4437ccd
Commit
b4437ccd
authored
Feb 21, 2024
by
Joel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: output lines
parent
65ac4ded
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
158 additions
and
154 deletions
+158
-154
page.tsx
web/app/(commonLayout)/workflow/nodes/page.tsx
+1
-1
panel.tsx
web/app/components/workflow/nodes/code/panel.tsx
+29
-24
use-config.ts
...app/components/workflow/nodes/direct-answer/use-config.ts
+5
-17
panel.tsx
web/app/components/workflow/nodes/llm/panel.tsx
+75
-70
node.tsx
...app/components/workflow/nodes/template-transform/node.tsx
+2
-1
panel.tsx
...pp/components/workflow/nodes/template-transform/panel.tsx
+46
-41
No files found.
web/app/(commonLayout)/workflow/nodes/page.tsx
View file @
b4437ccd
...
...
@@ -48,7 +48,7 @@ const Page: FC = () => {
* 2 directAnswer 3: llm 5: questionClassifier
* 7 Code, 8 TemplateTransform
*/
selectedNodeId=
'
8
'
selectedNodeId=
'
3
'
/>
</
div
>
)
...
...
web/app/components/workflow/nodes/code/panel.tsx
View file @
b4437ccd
...
...
@@ -33,7 +33,8 @@ const Panel: FC = () => {
handleCodeLanguageChange
,
}
=
useConfig
(
mockData
)
return
(
<
div
className=
'mt-2 px-4 space-y-4'
>
<
div
className=
'mt-2'
>
<
div
className=
'px-4 pb-4 space-y-4'
>
<
Field
title=
{
t
(
`${i18nPrefix}.inputVars`
)
}
operations=
{
...
...
@@ -58,7 +59,11 @@ const Panel: FC = () => {
value=
{
inputs
.
code
}
onChange=
{
handleCodeChange
}
/>
</
div
>
<
Split
/>
<
div
className=
'px-4 pt-4 pb-2'
>
output var
</
div
>
</
div
>
)
}
...
...
web/app/components/workflow/nodes/direct-answer/use-config.ts
View file @
b4437ccd
import
{
useCallback
,
useState
}
from
'react'
import
produce
from
'immer'
import
type
{
Variable
}
from
'../../types
'
import
useVarList
from
'../_base/hooks/use-var-list
'
import
type
{
DirectAnswerNodeType
}
from
'./types'
const
useConfig
=
(
initInputs
:
DirectAnswerNodeType
)
=>
{
const
[
inputs
,
setInputs
]
=
useState
<
DirectAnswerNodeType
>
(
initInputs
)
// variables
const
handleVarListChange
=
useCallback
((
newList
:
Variable
[])
=>
{
const
newInputs
=
produce
(
inputs
,
(
draft
)
=>
{
draft
.
variables
=
newList
})
setInputs
(
newInputs
)
},
[
inputs
,
setInputs
])
const
handleAddVariable
=
useCallback
(()
=>
{
const
newInputs
=
produce
(
inputs
,
(
draft
)
=>
{
draft
.
variables
.
push
({
variable
:
''
,
value_selector
:
[],
})
const
{
handleVarListChange
,
handleAddVariable
}
=
useVarList
<
DirectAnswerNodeType
>
({
inputs
,
setInputs
,
})
setInputs
(
newInputs
)
},
[
inputs
,
setInputs
])
const
handleAnswerChange
=
useCallback
((
value
:
string
)
=>
{
const
newInputs
=
produce
(
inputs
,
(
draft
)
=>
{
...
...
web/app/components/workflow/nodes/llm/panel.tsx
View file @
b4437ccd
...
...
@@ -29,7 +29,8 @@ const Panel: FC = () => {
// const isChatMode = modelMode === 'chat'
return
(
<
div
className=
'mt-2 px-4 space-y-4'
>
<
div
className=
'mt-2'
>
<
div
className=
'px-4 pb-4 space-y-4'
>
<
Field
title=
{
t
(
`${i18nPrefix}.model`
)
}
>
...
...
@@ -88,7 +89,9 @@ const Panel: FC = () => {
>
Vision
</
Field
>
</
div
>
<
Split
/>
<
div
className=
'px-4 pt-4 pb-2'
>
<
OutputVars
>
<>
<
VarItem
...
...
@@ -104,6 +107,8 @@ const Panel: FC = () => {
</>
</
OutputVars
>
</
div
>
</
div
>
)
}
...
...
web/app/components/workflow/nodes/template-transform/node.tsx
View file @
b4437ccd
...
...
@@ -2,7 +2,8 @@ import type { FC } from 'react'
const
Node
:
FC
=
()
=>
{
return
(
<
div
>
template-transform
</
div
>
// No summary content
<
div
></
div
>
)
}
...
...
web/app/components/workflow/nodes/template-transform/panel.tsx
View file @
b4437ccd
...
...
@@ -23,7 +23,9 @@ const Panel: FC = () => {
handleCodeChange
,
}
=
useConfig
(
mockData
)
return
(
<
div
className=
'mt-2 px-4 space-y-4'
>
<
div
className=
'mt-2'
>
<
div
className=
'px-4 pb-4 space-y-4'
>
<
Field
title=
{
t
(
`${i18nPrefix}.inputVars`
)
}
operations=
{
...
...
@@ -56,7 +58,9 @@ const Panel: FC = () => {
value=
{
inputs
.
template
}
onChange=
{
handleCodeChange
}
/>
</
div
>
<
Split
/>
<
div
className=
'px-4 pt-4 pb-2'
>
<
OutputVars
>
<>
<
VarItem
...
...
@@ -67,6 +71,7 @@ const Panel: FC = () => {
</>
</
OutputVars
>
</
div
>
</
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