From f3d49eab64dd8c23023c0d8fc188b57efa6d88b1 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Tue, 23 Jan 2024 00:13:01 -0800 Subject: [PATCH] Hide long time idle neighbors (#1082) * Dont show neighbor we can't resolve or route to * Hide neighbor which have been non-routable for over an hour --- files/usr/local/bin/mgr/lqm.lua | 2 ++ files/www/cgi-bin/lqm | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/files/usr/local/bin/mgr/lqm.lua b/files/usr/local/bin/mgr/lqm.lua index 2c2ae956..7ba21404 100755 --- a/files/usr/local/bin/mgr/lqm.lua +++ b/files/usr/local/bin/mgr/lqm.lua @@ -490,6 +490,7 @@ function lqm() device = station.device, firstseen = now, lastseen = now, + lastrouted = now, pending = now + pending_timeout, refresh = 0, mac = station.mac, @@ -689,6 +690,7 @@ function lqm() local rt = track.ip and ip.route(track.ip) or nil if rt and tostring(rt.gw) == track.ip then track.routable = true + track.lastrouted = now else track.routable = false end diff --git a/files/www/cgi-bin/lqm b/files/www/cgi-bin/lqm index 0abd7d08..1a58be13 100755 --- a/files/www/cgi-bin/lqm +++ b/files/www/cgi-bin/lqm @@ -220,7 +220,9 @@ html.print([[
} break; } - links += `
${name(track)}${track.type}${get_snr(track)}${distance}${quality}${status}
`; + if (track.lastrouted + 3600 > data.info.now && (status !== "idle" || track.hostname)) { + links += `
${name(track)}${track.type}${get_snr(track)}${distance}${quality}${status}
`; + } }); if (links.length) { document.getElementById("links").innerHTML = links;