mirror of https://github.com/aredn/aredn.git
Handle out of range link quality multipliers (#1298)
This commit is contained in:
parent
f8c01e88ec
commit
a6a00cc432
|
@ -214,8 +214,8 @@ if (tracker) {
|
|||
</div>
|
||||
{%
|
||||
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);
|
||||
%}
|
||||
<div class="cols">
|
||||
|
|
|
@ -108,8 +108,8 @@
|
|||
const status = calcColor(tracker);
|
||||
print("<div class='cols " + status + "'>");
|
||||
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(`<div style='flex:0.75'><a onclick="event.stopPropagation()" title='Link status: ${status}' href='http://${tracker.hostname}.local.mesh'>${tracker.hostname}</a></div>`);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue