From 83e852044e389a7f7755bc24eccd0632ff599c42 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Wed, 18 Sep 2024 19:30:54 -0700 Subject: [PATCH] Improve link status hint text (#1541) --- .../app/partial/local-and-neighbor-devices.ut | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/files/app/partial/local-and-neighbor-devices.ut b/files/app/partial/local-and-neighbor-devices.ut index fd33b1fb..8aa3c765 100755 --- a/files/app/partial/local-and-neighbor-devices.ut +++ b/files/app/partial/local-and-neighbor-devices.ut @@ -41,6 +41,21 @@ function calcColor(tracker) { if (tracker.blocked) { + if (tracker.blocks.user) { + return "blocked by user"; + } + if (tracker.blocks.signal) { + return "blocked low signal"; + } + if (tracker.blocks.signal) { + return "blocked too far"; + } + if (tracker.blocks.quality) { + return "blocked by errors or latency"; + } + if (tracker.blocks.dup || tracker.blocks.dtd) { + return "blocked as duplicate"; + } return "blocked"; } if (!tracker.routable) { @@ -106,15 +121,15 @@ for (let i = 0; i < length(llist); i++) { const tracker = trackers[llist[i].mac]; const status = calcColor(tracker); - print(`
`); + print(`
`); const link = links[tracker.ip] || {}; 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)) + "%") : "-"; if (tracker.hostname) { - print(`
${tracker.hostname}
`); + print(`
${tracker.hostname}
`); } else { - print(`
${tracker.ip}
`); + print(`
${tracker.ip}
`); } print("
"); print(`
${lq}
${nlq}
${100 - tracker.quality}%
`);