diff --git a/files/app/main/status/e/neighbor-device.ut b/files/app/main/status/e/neighbor-device.ut index d2a5f71c..60c2a736 100755 --- a/files/app/main/status/e/neighbor-device.ut +++ b/files/app/main/status/e/neighbor-device.ut @@ -214,8 +214,8 @@ if (tracker) { {% if (l && l.lossMultiplier) { - const lq = int(100 * l.linkQuality * 65536 / l.lossMultiplier); - const nlq = int(100 * l.neighborLinkQuality * 65536 / l.lossMultiplier); + const lq = min(100, int(100 * l.linkQuality * 65536 / l.lossMultiplier)); + const nlq = min(100, int(100 * l.neighborLinkQuality * 65536 / l.lossMultiplier)); const etx = 10000.0 / (lq * nlq); %}
diff --git a/files/app/partial/local-and-neighbor-devices.ut b/files/app/partial/local-and-neighbor-devices.ut index 34db7371..0c42ad73 100755 --- a/files/app/partial/local-and-neighbor-devices.ut +++ b/files/app/partial/local-and-neighbor-devices.ut @@ -108,8 +108,8 @@ const status = calcColor(tracker); print("
"); const link = links[tracker.ip] || {}; - const lq = link.lossMultiplier ? (int(100 * link.linkQuality * 65536 / link.lossMultiplier) + "%"): "-"; - const nlq = link.lossMultiplier ? (int(100 * link.neighborLinkQuality * 65536 / link.lossMultiplier) + "%") : "-"; + 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}
`); }