Improve display of blocked neighbors (#1709)

This commit is contained in:
Tim Wilkinson 2024-11-20 11:23:30 -08:00 committed by GitHub
parent d32ad316b6
commit 91fe800447
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 4 deletions

View File

@ -139,6 +139,17 @@
else {
push(nlist, { name: (tracker && tracker.hostname) || `|${link.remoteIP}`, tracker: tracker, link: link });
}
delete trackers[link.remoteIP];
}
for (let remoteIP in trackers)
{
const tracker = trackers[remoteIP];
if (tracker.type == "DtD" && tracker.distance < 100) {
push(llist, { name: tracker.hostname || `|${remoteIP}`, tracker: tracker, link: null });
}
else {
push(nlist, { name: tracker.hostname || `|${remoteIP}`, tracker: tracker, link: null });
}
}
if (length(llist) > 0) {
sort(llist, (a, b) => a.name == b.name ? 0 : a.name < b.name ? -1 : 1);
@ -153,8 +164,8 @@
else {
print(`<div class="ctrl cols status unknown" title="Link status: unknown">`);
}
const lq = link.lossMultiplier ? (min(100, int(100 * link.linkQuality * 65536 / link.lossMultiplier)) + "%") : "-";
const nlq = link.lossMultiplier ? (min(100, int(100 * link.neighborLinkQuality * 65536 / link.lossMultiplier)) + "%") : "-";
const lq = link && link.lossMultiplier ? (min(100, int(100 * link.linkQuality * 65536 / link.lossMultiplier)) + "%") : "-";
const nlq = link && link.lossMultiplier ? (min(100, int(100 * link.neighborLinkQuality * 65536 / link.lossMultiplier)) + "%") : "-";
if (substr(entry.name, 0, 1) !== "|") {
print(`<div class='h'><a onclick="event.stopPropagation()" href='http://${entry.name}.local.mesh'>${entry.name}</a></div>`);
}
@ -195,8 +206,8 @@
else {
print(`<div class="ctrl cols status unknown" title="Link status: unknown">`);
}
const lq = link.lossMultiplier ? (min(100, int(100 * link.linkQuality * 65536 / link.lossMultiplier)) + "%") : "-";
const nlq = link.lossMultiplier ? (min(100, int(100 * link.neighborLinkQuality * 65536 / link.lossMultiplier)) + "%") : "-";
const lq = link && link.lossMultiplier ? (min(100, int(100 * link.linkQuality * 65536 / link.lossMultiplier)) + "%") : "-";
const nlq = link && link.lossMultiplier ? (min(100, int(100 * link.neighborLinkQuality * 65536 / link.lossMultiplier)) + "%") : "-";
let icon = "";
let title = "";
switch (tracker && tracker.type || "Unknown") {