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
6caca3aa
Commit
6caca3aa
authored
Feb 19, 2024
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base panel
parent
3d3bc4c5
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
34 additions
and
96 deletions
+34
-96
panel.tsx
web/app/components/workflow/nodes/_base/panel.tsx
+4
-56
panel.tsx
web/app/components/workflow/nodes/code/panel.tsx
+3
-4
panel.tsx
web/app/components/workflow/nodes/direct-answer/panel.tsx
+3
-4
panel.tsx
web/app/components/workflow/nodes/end/panel.tsx
+3
-4
panel.tsx
web/app/components/workflow/nodes/http/panel.tsx
+3
-4
panel.tsx
web/app/components/workflow/nodes/if-else/panel.tsx
+3
-4
panel.tsx
...p/components/workflow/nodes/knowledge-retrieval/panel.tsx
+3
-4
panel.tsx
...p/components/workflow/nodes/question-classifier/panel.tsx
+3
-4
panel.tsx
web/app/components/workflow/nodes/start/panel.tsx
+3
-4
panel.tsx
...pp/components/workflow/nodes/template-transform/panel.tsx
+3
-4
panel.tsx
web/app/components/workflow/nodes/tool/panel.tsx
+3
-4
No files found.
web/app/components/workflow/nodes/_base/panel.tsx
View file @
6caca3aa
...
@@ -2,36 +2,20 @@ import type {
...
@@ -2,36 +2,20 @@ import type {
FC
,
FC
,
ReactNode
,
ReactNode
,
}
from
'react'
}
from
'react'
import
{
useState
}
from
'react'
import
{
useWorkflowContext
}
from
'../../context'
import
{
useWorkflowContext
}
from
'../../context'
import
BlockIcon
from
'../../block-icon'
import
BlockIcon
from
'../../block-icon'
import
{
getBlockByType
}
from
'../../block-selector/utils'
import
{
getBlockByType
}
from
'../../block-selector/utils'
import
NextStep
from
'./components/next-step'
import
NextStep
from
'./components/next-step'
import
{
import
{
XClose
}
from
'@/app/components/base/icons/src/vender/line/general'
LogIn04
,
LogOut04
,
XClose
,
}
from
'@/app/components/base/icons/src/vender/line/general'
import
{
GitBranch01
}
from
'@/app/components/base/icons/src/vender/line/development'
import
{
GitBranch01
}
from
'@/app/components/base/icons/src/vender/line/development'
enum
TabEnum
{
Inputs
=
'inputs'
,
Outputs
=
'outputs'
,
}
type
BasePanelProps
=
{
type
BasePanelProps
=
{
defaultElement
?:
ReactNode
children
?:
ReactNode
inputsElement
?:
ReactNode
outputsElement
?:
ReactNode
}
}
const
BasePanel
:
FC
<
BasePanelProps
>
=
({
const
BasePanel
:
FC
<
BasePanelProps
>
=
({
defaultElement
,
children
,
inputsElement
,
outputsElement
,
})
=>
{
})
=>
{
const
initialActiveTab
=
inputsElement
?
TabEnum
.
Inputs
:
outputsElement
?
TabEnum
.
Outputs
:
''
const
[
activeTab
,
setActiveTab
]
=
useState
(
initialActiveTab
)
const
{
const
{
handleSelectedNodeIdChange
,
handleSelectedNodeIdChange
,
selectedNode
,
selectedNode
,
...
@@ -61,45 +45,9 @@ const BasePanel: FC<BasePanelProps> = ({
...
@@ -61,45 +45,9 @@ const BasePanel: FC<BasePanelProps> = ({
Add description...
Add description...
</
div
>
</
div
>
</
div
>
</
div
>
{
(
inputsElement
||
outputsElement
)
&&
(
<
div
className=
'flex items-center px-4 h-[42px] text-[13px] font-semibold text-gray-400'
>
{
inputsElement
&&
(
<
div
className=
{
`relative flex items-center h-full cursor-pointer ${activeTab === TabEnum.Inputs && 'text-gray-700'}`
}
onClick=
{
()
=>
setActiveTab
(
TabEnum
.
Inputs
)
}
>
<
LogIn04
className=
'mr-1 w-4 h-4'
/>
INPUTS
{
activeTab
===
TabEnum
.
Inputs
&&
<
div
className=
'absolute left-0 bottom-0 w-full h-0.5 bg-primary-600'
/>
}
</
div
>
)
}
{
outputsElement
&&
(
<
div
className=
{
`relative flex items-center ml-4 h-full cursor-pointer ${activeTab === TabEnum.Outputs && 'text-gray-700'}`
}
onClick=
{
()
=>
setActiveTab
(
TabEnum
.
Outputs
)
}
>
<
LogOut04
className=
'mr-1 w-4 h-4'
/>
OUTPUTS
{
activeTab
===
TabEnum
.
Outputs
&&
<
div
className=
'absolute left-0 bottom-0 w-full h-0.5 bg-primary-600'
/>
}
</
div
>
)
}
</
div
>
)
}
</
div
>
</
div
>
<
div
className=
'py-2 border-b-[0.5px] border-black/5'
>
<
div
className=
'py-2 border-b-[0.5px] border-black/5'
>
{
defaultElement
}
{
children
}
{
activeTab
===
TabEnum
.
Inputs
&&
inputsElement
}
{
activeTab
===
TabEnum
.
Outputs
&&
outputsElement
}
</
div
>
</
div
>
<
div
className=
'p-4'
>
<
div
className=
'p-4'
>
<
div
className=
'flex items-center mb-1 text-gray-700 text-[13px] font-semibold'
>
<
div
className=
'flex items-center mb-1 text-gray-700 text-[13px] font-semibold'
>
...
...
web/app/components/workflow/nodes/code/panel.tsx
View file @
6caca3aa
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
const
Panel
:
FC
=
()
=>
{
const
Panel
:
FC
=
()
=>
{
return
(
return
(
<
BasePanel
<
BasePanel
>
inputsElement=
{
<
div
>
start panel inputs
</
div
>
}
<
div
>
start panel inputs
</
div
>
outputsElement=
{
<
div
>
start panel outputs
</
div
>
}
</
BasePanel
>
/>
)
)
}
}
...
...
web/app/components/workflow/nodes/direct-answer/panel.tsx
View file @
6caca3aa
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
const
Panel
:
FC
=
()
=>
{
const
Panel
:
FC
=
()
=>
{
return
(
return
(
<
BasePanel
<
BasePanel
>
inputsElement=
{
<
div
>
start panel inputs
</
div
>
}
<
div
>
start panel inputs
</
div
>
outputsElement=
{
<
div
>
start panel outputs
</
div
>
}
</
BasePanel
>
/>
)
)
}
}
...
...
web/app/components/workflow/nodes/end/panel.tsx
View file @
6caca3aa
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
const
Panel
:
FC
=
()
=>
{
const
Panel
:
FC
=
()
=>
{
return
(
return
(
<
BasePanel
<
BasePanel
>
inputsElement=
{
<
div
>
start panel inputs
</
div
>
}
<
div
>
start panel inputs
</
div
>
outputsElement=
{
<
div
>
start panel outputs
</
div
>
}
</
BasePanel
>
/>
)
)
}
}
...
...
web/app/components/workflow/nodes/http/panel.tsx
View file @
6caca3aa
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
const
Panel
:
FC
=
()
=>
{
const
Panel
:
FC
=
()
=>
{
return
(
return
(
<
BasePanel
<
BasePanel
>
inputsElement=
{
<
div
>
start panel inputs
</
div
>
}
<
div
>
start panel inputs
</
div
>
outputsElement=
{
<
div
>
start panel outputs
</
div
>
}
</
BasePanel
>
/>
)
)
}
}
...
...
web/app/components/workflow/nodes/if-else/panel.tsx
View file @
6caca3aa
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
const
Panel
:
FC
=
()
=>
{
const
Panel
:
FC
=
()
=>
{
return
(
return
(
<
BasePanel
<
BasePanel
>
inputsElement=
{
<
div
>
start panel inputs
</
div
>
}
<
div
>
start panel inputs
</
div
>
outputsElement=
{
<
div
>
start panel outputs
</
div
>
}
</
BasePanel
>
/>
)
)
}
}
...
...
web/app/components/workflow/nodes/knowledge-retrieval/panel.tsx
View file @
6caca3aa
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
const
Panel
:
FC
=
()
=>
{
const
Panel
:
FC
=
()
=>
{
return
(
return
(
<
BasePanel
<
BasePanel
>
inputsElement=
{
<
div
>
start panel inputs
</
div
>
}
<
div
>
start panel inputs
</
div
>
outputsElement=
{
<
div
>
start panel outputs
</
div
>
}
</
BasePanel
>
/>
)
)
}
}
...
...
web/app/components/workflow/nodes/question-classifier/panel.tsx
View file @
6caca3aa
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
const
Panel
:
FC
=
()
=>
{
const
Panel
:
FC
=
()
=>
{
return
(
return
(
<
BasePanel
<
BasePanel
>
inputsElement=
{
<
div
>
start panel inputs
</
div
>
}
<
div
>
start panel inputs
</
div
>
outputsElement=
{
<
div
>
start panel outputs
</
div
>
}
</
BasePanel
>
/>
)
)
}
}
...
...
web/app/components/workflow/nodes/start/panel.tsx
View file @
6caca3aa
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
const
Panel
:
FC
=
()
=>
{
const
Panel
:
FC
=
()
=>
{
return
(
return
(
<
BasePanel
<
BasePanel
>
inputsElement=
{
<
div
>
start panel inputs
</
div
>
}
<
div
>
start panel inputs
</
div
>
outputsElement=
{
<
div
>
start panel outputs
</
div
>
}
</
BasePanel
>
/>
)
)
}
}
...
...
web/app/components/workflow/nodes/template-transform/panel.tsx
View file @
6caca3aa
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
const
Panel
:
FC
=
()
=>
{
const
Panel
:
FC
=
()
=>
{
return
(
return
(
<
BasePanel
<
BasePanel
>
inputsElement=
{
<
div
>
start panel inputs
</
div
>
}
<
div
>
start panel inputs
</
div
>
outputsElement=
{
<
div
>
start panel outputs
</
div
>
}
</
BasePanel
>
/>
)
)
}
}
...
...
web/app/components/workflow/nodes/tool/panel.tsx
View file @
6caca3aa
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
...
@@ -3,10 +3,9 @@ import BasePanel from '../_base/panel'
const
Panel
:
FC
=
()
=>
{
const
Panel
:
FC
=
()
=>
{
return
(
return
(
<
BasePanel
<
BasePanel
>
inputsElement=
{
<
div
>
start panel inputs
</
div
>
}
<
div
>
start panel inputs
</
div
>
outputsElement=
{
<
div
>
start panel outputs
</
div
>
}
</
BasePanel
>
/>
)
)
}
}
...
...
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