diff --git a/frontend/src/GraphView.jsx b/frontend/src/GraphView.jsx index c556e3d..ac60227 100644 --- a/frontend/src/GraphView.jsx +++ b/frontend/src/GraphView.jsx @@ -2,7 +2,6 @@ import React, { useMemo, useCallback, useEffect, useRef } from 'react'; import { ReactFlow, Background, - Controls, MiniMap, useEdgesState, useNodesState, @@ -10,10 +9,12 @@ import { MarkerType, } from '@xyflow/react'; import '@xyflow/react/dist/style.css'; +import { IconZoomIn, IconZoomOut, IconMaximize, IconMinimize } from '@tabler/icons-react'; function GraphView({ servers, connections }) { const flowRef = useRef(null); const instanceRef = useRef(null); + const containerRef = useRef(null); const getTunnelStyle = useCallback((tunnelType) => { const map = { @@ -89,6 +90,15 @@ function GraphView({ servers, connections }) { server: ({ data }) => { const s = data.server || {}; const countryColor = getCountryColor(s.country); + const getFlagEmoji = (code) => { + if (!code) return ''; + const map = { SWE: 'SE', UK: 'GB' }; + const ccRaw = String(code).trim().toUpperCase(); + const cc = (map[ccRaw] || ccRaw).slice(0, 2); + if (cc.length !== 2) return ccRaw; + return cc.replace(/./g, (ch) => String.fromCodePoint(127397 + ch.charCodeAt())); + }; + const flag = getFlagEmoji(s.country); return (
- - {String(s.country || '').toUpperCase().slice(0, 3)} - +
+ {flag} + + {String(s.country || '').toUpperCase().slice(0, 3)} + +
{s.dns}
@@ -160,7 +173,7 @@ function GraphView({ servers, connections }) { } return ( -
+
- + {/* Своя панель управления: -, +, Fit, Fullscreen */} +
+
+ + + + +
+
); }