mirror of https://github.com/langgenius/dify.git
This commit is contained in:
parent
57e9e229de
commit
0367a2148a
|
|
@ -71,7 +71,7 @@ const Workflow: FC<WorkflowProps> = memo(({
|
|||
useKeyPress('Backspace', handleEdgeDelete)
|
||||
|
||||
return (
|
||||
<div className='relative w-full h-full'>
|
||||
<div className='relative w-full h-full bg-[#F0F2F7]'>
|
||||
<Header />
|
||||
<Panel />
|
||||
<Operator />
|
||||
|
|
@ -99,7 +99,8 @@ const Workflow: FC<WorkflowProps> = memo(({
|
|||
>
|
||||
<Background
|
||||
gap={[14, 14]}
|
||||
size={1}
|
||||
size={2}
|
||||
color='#E4E5E7'
|
||||
/>
|
||||
</ReactFlow>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import {
|
|||
memo,
|
||||
useState,
|
||||
} from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useReactFlow } from 'reactflow'
|
||||
import {
|
||||
PortalToFollowElem,
|
||||
|
|
@ -13,39 +14,40 @@ import {
|
|||
import { SearchLg } from '@/app/components/base/icons/src/vender/line/general'
|
||||
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 { t } = useTranslation()
|
||||
const reactFlow = useReactFlow()
|
||||
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) => {
|
||||
if (type === 'in')
|
||||
reactFlow.zoomIn()
|
||||
|
|
@ -55,6 +57,12 @@ const ZoomInOut: FC = () => {
|
|||
|
||||
if (type === 'fit')
|
||||
reactFlow.fitView()
|
||||
|
||||
if (type === 'to50')
|
||||
reactFlow.zoomTo(0.5)
|
||||
|
||||
if (type === 'to100')
|
||||
reactFlow.zoomTo(1)
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -12,6 +12,13 @@ const translation = {
|
|||
'http-request': 'HTTP Request',
|
||||
'variable-assigner': 'Variable Assigner',
|
||||
},
|
||||
operator: {
|
||||
zoomIn: 'Zoom In',
|
||||
zoomOut: 'Zoom Out',
|
||||
zoomTo50: 'Zoom to 50%',
|
||||
zoomTo100: 'Zoom to 100%',
|
||||
zoomToFit: 'Zoom to Fit',
|
||||
},
|
||||
nodes: {
|
||||
common: {
|
||||
outputVars: 'Output Variables',
|
||||
|
|
|
|||
|
|
@ -12,6 +12,13 @@ const translation = {
|
|||
'http-request': 'HTTP 请求',
|
||||
'variable-assigner': '变量赋值',
|
||||
},
|
||||
operator: {
|
||||
zoomIn: '放大',
|
||||
zoomOut: '缩小',
|
||||
zoomTo50: '缩放到 50%',
|
||||
zoomTo100: '放大到 100%',
|
||||
zoomToFit: '自适应视图',
|
||||
},
|
||||
nodes: {
|
||||
common: {
|
||||
outputVars: '输出变量',
|
||||
|
|
|
|||
Loading…
Reference in New Issue