fix(ui): показывать сведения о рукопожатии без ложного статуса

This commit is contained in:
Denozordec committed 2026-10-04 12:21:53 +07:00
1 parent 837298a171
commit c6702efcc4
9 files changed
+53 -16

No files matched your search

+6 -5
View File
@@ -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: <span className="block text-xs text-muted-foreground">Доступность пиров не проверена</span>,
icon: <KeyRoundIcon className="size-4" />,
iconClassName: "text-primary",
},