From c6702efcc41b6fff29025ee6034e2881e0f8fadd Mon Sep 17 00:00:00 2001 From: Denozordec Date: Sun, 4 Oct 2026 12:21:53 +0700 Subject: [PATCH] =?UTF-8?q?fix(ui):=20=D0=BF=D0=BE=D0=BA=D0=B0=D0=B7=D1=8B?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D1=8C=20=D1=81=D0=B2=D0=B5=D0=B4=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BE=20=D1=80=D1=83=D0=BA=D0=BE=D0=BF=D0=BE?= =?UTF-8?q?=D0=B6=D0=B0=D1=82=D0=B8=D0=B8=20=D0=B1=D0=B5=D0=B7=20=D0=BB?= =?UTF-8?q?=D0=BE=D0=B6=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=81=D1=82=D0=B0=D1=82?= =?UTF-8?q?=D1=83=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/(main)/wireguard/page.tsx | 11 +++++---- components/data-grids/wireguard-data-grid.tsx | 7 ++---- .../data-grids/wireguard-peers-detail.tsx | 6 ++--- .../data-grids/wireguard-peers-grid.tsx | 4 ++-- docs/ux-ui-plan.md | 2 +- docs/ux-ui-progress.md | 8 +++++++ docs/ux-ui-stage-12.md | 9 +++++++ .../ux-ui/screens/wireguard-handshake-320.png | Bin 0 -> 50159 bytes tests/e2e/wireguard-tables.spec.ts | 22 ++++++++++++++++++ 9 files changed, 53 insertions(+), 16 deletions(-) create mode 100644 docs/ux-ui/screens/wireguard-handshake-320.png diff --git a/app/(main)/wireguard/page.tsx b/app/(main)/wireguard/page.tsx index 24c36fac..dc9acc75 100644 --- a/app/(main)/wireguard/page.tsx +++ b/app/(main)/wireguard/page.tsx @@ -384,8 +384,8 @@ function WireGuardPageContent({ selectedServerId, selectedInterfaceId, allInterf }, [scopedIfaces, search]) const totalPeers = scopedIfaces.reduce((s, i) => s + i.peers.length, 0) - const onlinePeers = scopedIfaces.reduce( - (s, i) => s + i.peers.filter((p) => !!p.latestHandshake).length, + const peersWithHandshakeData = scopedIfaces.reduce( + (s, i) => s + i.peers.filter((p) => !!p.latestHandshake?.trim()).length, 0, ) const upIfaces = scopedIfaces.filter((i) => i.status === "up").length @@ -754,9 +754,10 @@ function WireGuardPageContent({ selectedServerId, selectedInterfaceId, allInterf iconClassName: "text-info", }, { - id: "online", - label: "Пиров онлайн", - value: `${onlinePeers}/${totalPeers}`, + id: "handshake-data", + label: "Данные рукопожатия", + value: `${peersWithHandshakeData}/${totalPeers}`, + hint: Доступность пиров не проверена, icon: , iconClassName: "text-primary", }, diff --git a/components/data-grids/wireguard-data-grid.tsx b/components/data-grids/wireguard-data-grid.tsx index a2e23f45..68cb633d 100644 --- a/components/data-grids/wireguard-data-grid.tsx +++ b/components/data-grids/wireguard-data-grid.tsx @@ -86,7 +86,6 @@ function WireguardDataGrid({ cell: ({ row }) => { const iface = row.original const expanded = row.getIsExpanded() - const onlinePeers = iface.peers.filter((p) => !!p.latestHandshake).length return (
) : null}

- {onlinePeers}/{iface.peers.length} пиров + {iface.peers.length} пиров

@@ -164,11 +163,9 @@ function WireguardDataGrid({ enableSorting: false, cell: ({ row }) => { const iface = row.original - const onlinePeers = iface.peers.filter((p) => !!p.latestHandshake).length return ( - {onlinePeers} - /{iface.peers.length} + {iface.peers.length} ) }, diff --git a/components/data-grids/wireguard-peers-detail.tsx b/components/data-grids/wireguard-peers-detail.tsx index 29c446a2..096153d9 100644 --- a/components/data-grids/wireguard-peers-detail.tsx +++ b/components/data-grids/wireguard-peers-detail.tsx @@ -82,10 +82,10 @@ function WireGuardPeersDetail({ - Последнее рукопожатие: {peer.latestHandshake ?? "нет рукопожатия"} + Последнее рукопожатие: {peer.latestHandshake?.trim() || "Нет данных"}
@@ -97,7 +97,7 @@ function WireGuardPeersDetail({ {fmtBytes(peer.transferTx)}
- Endpoint: {peer.endpoint ?? "—"} + Endpoint: {peer.endpoint ?? "—"}
{onExportPeer && (