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 && (