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
0367a214
Commit
0367a214
authored
Mar 05, 2024
by
StyleZhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bg
parent
57e9e229
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
31 deletions
+54
-31
index.tsx
web/app/components/workflow/index.tsx
+3
-2
zoom-in-out.tsx
web/app/components/workflow/operator/zoom-in-out.tsx
+37
-29
workflow.ts
web/i18n/en-US/workflow.ts
+7
-0
workflow.ts
web/i18n/zh-Hans/workflow.ts
+7
-0
No files found.
web/app/components/workflow/index.tsx
View file @
0367a214
...
@@ -71,7 +71,7 @@ const Workflow: FC<WorkflowProps> = memo(({
...
@@ -71,7 +71,7 @@ const Workflow: FC<WorkflowProps> = memo(({
useKeyPress
(
'Backspace'
,
handleEdgeDelete
)
useKeyPress
(
'Backspace'
,
handleEdgeDelete
)
return
(
return
(
<
div
className=
'relative w-full h-full'
>
<
div
className=
'relative w-full h-full
bg-[#F0F2F7]
'
>
<
Header
/>
<
Header
/>
<
Panel
/>
<
Panel
/>
<
Operator
/>
<
Operator
/>
...
@@ -99,7 +99,8 @@ const Workflow: FC<WorkflowProps> = memo(({
...
@@ -99,7 +99,8 @@ const Workflow: FC<WorkflowProps> = memo(({
>
>
<
Background
<
Background
gap=
{
[
14
,
14
]
}
gap=
{
[
14
,
14
]
}
size=
{
1
}
size=
{
2
}
color=
'#E4E5E7'
/>
/>
</
ReactFlow
>
</
ReactFlow
>
</
div
>
</
div
>
...
...
web/app/components/workflow/operator/zoom-in-out.tsx
View file @
0367a214
...
@@ -4,6 +4,7 @@ import {
...
@@ -4,6 +4,7 @@ import {
memo
,
memo
,
useState
,
useState
,
}
from
'react'
}
from
'react'
import
{
useTranslation
}
from
'react-i18next'
import
{
useReactFlow
}
from
'reactflow'
import
{
useReactFlow
}
from
'reactflow'
import
{
import
{
PortalToFollowElem
,
PortalToFollowElem
,
...
@@ -13,39 +14,40 @@ import {
...
@@ -13,39 +14,40 @@ import {
import
{
SearchLg
}
from
'@/app/components/base/icons/src/vender/line/general'
import
{
SearchLg
}
from
'@/app/components/base/icons/src/vender/line/general'
import
{
ChevronDown
}
from
'@/app/components/base/icons/src/vender/line/arrows'
import
{
ChevronDown
}
from
'@/app/components/base/icons/src/vender/line/arrows'
const
ZOOM_IN_OUT_OPTIONS
=
[
[
{
key
:
'in'
,
text
:
'Zoom In'
,
},
{
key
:
'out'
,
text
:
'Zoom Out'
,
},
],
[
{
key
:
'to50'
,
text
:
'Zoom to 50%'
,
},
{
key
:
'to100'
,
text
:
'Zoom to 100%'
,
},
],
[
{
key
:
'fit'
,
text
:
'Zoom to Fit'
,
},
],
]
const
ZoomInOut
:
FC
=
()
=>
{
const
ZoomInOut
:
FC
=
()
=>
{
const
{
t
}
=
useTranslation
()
const
reactFlow
=
useReactFlow
()
const
reactFlow
=
useReactFlow
()
const
[
open
,
setOpen
]
=
useState
(
false
)
const
[
open
,
setOpen
]
=
useState
(
false
)
const
ZOOM_IN_OUT_OPTIONS
=
[
[
{
key
:
'in'
,
text
:
t
(
'workflow.operator.zoomIn'
),
},
{
key
:
'out'
,
text
:
t
(
'workflow.operator.zoomOut'
),
},
],
[
{
key
:
'to50'
,
text
:
t
(
'workflow.operator.zoomTo50'
),
},
{
key
:
'to100'
,
text
:
t
(
'workflow.operator.zoomTo100'
),
},
],
[
{
key
:
'fit'
,
text
:
t
(
'workflow.operator.zoomToFit'
),
},
],
]
const
handleZoom
=
(
type
:
string
)
=>
{
const
handleZoom
=
(
type
:
string
)
=>
{
if
(
type
===
'in'
)
if
(
type
===
'in'
)
reactFlow
.
zoomIn
()
reactFlow
.
zoomIn
()
...
@@ -55,6 +57,12 @@ const ZoomInOut: FC = () => {
...
@@ -55,6 +57,12 @@ const ZoomInOut: FC = () => {
if
(
type
===
'fit'
)
if
(
type
===
'fit'
)
reactFlow
.
fitView
()
reactFlow
.
fitView
()
if
(
type
===
'to50'
)
reactFlow
.
zoomTo
(
0.5
)
if
(
type
===
'to100'
)
reactFlow
.
zoomTo
(
1
)
}
}
return
(
return
(
...
...
web/i18n/en-US/workflow.ts
View file @
0367a214
...
@@ -12,6 +12,13 @@ const translation = {
...
@@ -12,6 +12,13 @@ const translation = {
'http-request'
:
'HTTP Request'
,
'http-request'
:
'HTTP Request'
,
'variable-assigner'
:
'Variable Assigner'
,
'variable-assigner'
:
'Variable Assigner'
,
},
},
operator
:
{
zoomIn
:
'Zoom In'
,
zoomOut
:
'Zoom Out'
,
zoomTo50
:
'Zoom to 50%'
,
zoomTo100
:
'Zoom to 100%'
,
zoomToFit
:
'Zoom to Fit'
,
},
nodes
:
{
nodes
:
{
common
:
{
common
:
{
outputVars
:
'Output Variables'
,
outputVars
:
'Output Variables'
,
...
...
web/i18n/zh-Hans/workflow.ts
View file @
0367a214
...
@@ -12,6 +12,13 @@ const translation = {
...
@@ -12,6 +12,13 @@ const translation = {
'http-request'
:
'HTTP 请求'
,
'http-request'
:
'HTTP 请求'
,
'variable-assigner'
:
'变量赋值'
,
'variable-assigner'
:
'变量赋值'
,
},
},
operator
:
{
zoomIn
:
'放大'
,
zoomOut
:
'缩小'
,
zoomTo50
:
'缩放到 50%'
,
zoomTo100
:
'放大到 100%'
,
zoomToFit
:
'自适应视图'
,
},
nodes
:
{
nodes
:
{
common
:
{
common
:
{
outputVars
:
'输出变量'
,
outputVars
:
'输出变量'
,
...
...
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