Hide long time idle neighbors ()

* Dont show neighbor we can't resolve or route to

* Hide neighbor which have been non-routable for over an hour
This commit is contained in:
Tim Wilkinson 2024-01-23 00:13:01 -08:00 committed by GitHub
parent 434cfdf50a
commit f3d49eab64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions
files
usr/local/bin/mgr
www/cgi-bin

View File

@ -490,6 +490,7 @@ function lqm()
device = station.device, device = station.device,
firstseen = now, firstseen = now,
lastseen = now, lastseen = now,
lastrouted = now,
pending = now + pending_timeout, pending = now + pending_timeout,
refresh = 0, refresh = 0,
mac = station.mac, mac = station.mac,
@ -689,6 +690,7 @@ function lqm()
local rt = track.ip and ip.route(track.ip) or nil local rt = track.ip and ip.route(track.ip) or nil
if rt and tostring(rt.gw) == track.ip then if rt and tostring(rt.gw) == track.ip then
track.routable = true track.routable = true
track.lastrouted = now
else else
track.routable = false track.routable = false
end end

View File

@ -220,7 +220,9 @@ html.print([[<hr>
} }
break; break;
} }
links += `<div><span class="m">${name(track)}</span><span class="s">${track.type}</span><span class="s">${get_snr(track)}</span><span class="p">${distance}</span><span class="s">${quality}</span><span class="i">${status}</span></div>`; if (track.lastrouted + 3600 > data.info.now && (status !== "idle" || track.hostname)) {
links += `<div><span class="m">${name(track)}</span><span class="s">${track.type}</span><span class="s">${get_snr(track)}</span><span class="p">${distance}</span><span class="s">${quality}</span><span class="i">${status}</span></div>`;
}
}); });
if (links.length) { if (links.length) {
document.getElementById("links").innerHTML = links; document.getElementById("links").innerHTML = links;