diff --git a/apps/web/src/components/topology/edge-edit-sheet.tsx b/apps/web/src/components/topology/edge-edit-sheet.tsx index 9c8f14a..b5a77c0 100644 --- a/apps/web/src/components/topology/edge-edit-sheet.tsx +++ b/apps/web/src/components/topology/edge-edit-sheet.tsx @@ -35,6 +35,8 @@ export function EdgeEditSheet({ const [lineStyle, setLineStyle] = useState<'solid' | 'dashed'>('solid') const [direction, setDirection] = useState('forward') const [protocol, setProtocol] = useState('') + const [localIp, setLocalIp] = useState('') + const [remoteIp, setRemoteIp] = useState('') const [notes, setNotes] = useState('') useEffect(() => { @@ -44,9 +46,13 @@ export function EdgeEditSheet({ setLineStyle(d.lineStyle ?? 'solid') setDirection(d.direction ?? 'forward') setProtocol(d.protocol ?? '') + setLocalIp(d.localIp ?? '') + setRemoteIp(d.remoteIp ?? '') setNotes(d.notes ?? '') }, [data, edgeId, open]) + const showTunnelIps = relation === 'vpn' || relation === 'tunnel' + return ( setLabel(e.target.value)} disabled={locked} maxLength={60} - placeholder="Например: eth0 / 10 Gbit" + placeholder="Например: eth0 / uplink — рядом с протоколом" /> @@ -130,6 +138,32 @@ export function EdgeEditSheet({ placeholder="TCP/443, WireGuard, BGP…" /> + {showTunnelIps ? ( + <> + + setLocalIp(e.target.value)} + disabled={locked} + maxLength={45} + placeholder="10.8.0.1" + className="font-mono" + /> + + + setRemoteIp(e.target.value)} + disabled={locked} + maxLength={45} + placeholder="10.8.0.2" + className="font-mono" + /> + + + ) : null}