feat(NetworkMapDashboard): add ping functionality for jumphost and home servers to enhance network connectivity checks
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 2m4s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 2m4s
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user