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
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

View File

@ -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

View File

@ -220,7 +220,9 @@ html.print([[<hr>
}
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) {
document.getElementById("links").innerHTML = links;