mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-09 00:56:37 +08:00
fix(frontend): WAF 规则编辑器缩小编排区高度和首次适配缩放比例,默认显示更多画布上下文
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
type Connection,
|
||||
type Edge,
|
||||
type EdgeChange,
|
||||
type FitViewOptions,
|
||||
type Node,
|
||||
type NodeChange,
|
||||
type ReactFlowInstance,
|
||||
@@ -43,6 +44,10 @@ import { NodeLibrary } from './node-library';
|
||||
import { RuleNode, type RuleFlowNodeData } from './rule-node';
|
||||
|
||||
const nodeTypes = { rule: RuleNode };
|
||||
const initialFitViewOptions = {
|
||||
padding: 0.3,
|
||||
maxZoom: 0.85,
|
||||
} satisfies FitViewOptions;
|
||||
|
||||
type FlowNode = Node<RuleFlowNodeData>;
|
||||
type FlowEdge = Edge;
|
||||
@@ -323,6 +328,7 @@ export function RuleFlowCanvas({
|
||||
onSelectEdge(undefined);
|
||||
}}
|
||||
fitView
|
||||
fitViewOptions={initialFitViewOptions}
|
||||
deleteKeyCode={['Backspace', 'Delete']}
|
||||
>
|
||||
<Background gap={20} size={1} />
|
||||
|
||||
@@ -184,7 +184,7 @@ function EditorContent() {
|
||||
return <EditorSkeleton />;
|
||||
|
||||
return (
|
||||
<div className='flex h-[calc(100dvh-4rem)] w-full flex-col px-1 py-6'>
|
||||
<div className='flex h-[calc(100dvh-8rem)] w-full flex-col px-1 py-6'>
|
||||
<UnsavedChanges dirty={dirty} />
|
||||
<header className='mb-4 flex items-center justify-between gap-4'>
|
||||
<div className='flex min-w-0 items-center gap-2'>
|
||||
|
||||
@@ -4559,4 +4559,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
Reference in New Issue
Block a user