From 683f837b36485af024d9191a7785b48889018016 Mon Sep 17 00:00:00 2001 From: shats Date: Tue, 17 Feb 2026 16:27:47 +0700 Subject: [PATCH] feat(NetworkMapDashboard): add ping functionality for jumphost and home servers to enhance network connectivity checks --- frontend/src/NetworkMapDashboard.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/src/NetworkMapDashboard.jsx b/frontend/src/NetworkMapDashboard.jsx index c99ee7a..a7a977c 100644 --- a/frontend/src/NetworkMapDashboard.jsx +++ b/frontend/src/NetworkMapDashboard.jsx @@ -89,6 +89,13 @@ export default function NetworkMapDashboard() { const from = String(c.from); const to = String(c.to); if (!from || !to || from === to) return; + const srcFrom = servers.find((s) => s.ip === from); + const srcTo = servers.find((s) => s.ip === to); + const canPingFrom = srcFrom && ['jumphost', 'home'].includes(String(srcFrom.type || '').toLowerCase()); + const canPingTo = srcTo && ['jumphost', 'home'].includes(String(srcTo.type || '').toLowerCase()); + + // Пингуем только с jumphost/home, иначе бекенд возвращает E_PING (сервер не найден) + if (canPingFrom) { tasks.push(async () => { if (pingAbortRef.current) return; try { @@ -103,6 +110,9 @@ export default function NetworkMapDashboard() { return { key: key(from, to), ms: null }; } }); + } + + if (canPingTo) { tasks.push(async () => { if (pingAbortRef.current) return; try { @@ -117,6 +127,7 @@ export default function NetworkMapDashboard() { return { key: key(to, from), ms: null }; } }); + } }); const results = await runWithLimit(tasks, 4);