luci-app-olsr: correctness fixes

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
Paul Donald
2026-05-22 14:32:21 +03:00
parent 177cf48dca
commit 0b93761a38
5 changed files with 7 additions and 5 deletions
@@ -153,5 +153,7 @@ const olsrview = view.extend({
return L.Class.extend({
olsrview: olsrview,
etx_color: etx_color,
snr_colors: snr_colors,
});
@@ -25,7 +25,7 @@ return olsr.olsrview.extend({
if (a.proto === b.proto) {
return a.genmask < b.genmask;
} else {
return a.proto < b.proto;
return a.proto < b.proto ? -1 : a.proto > b.proto ? 1 : 0;
}
}
let modifiedData;
@@ -20,7 +20,7 @@ return olsr.olsrview.extend({
if (a.proto === b.proto) {
return a.linkCost < b.linkCost;
} else {
return a.proto < b.proto;
return a.proto < b.proto ? -1 : a.proto > b.proto ? 1 : 0;
}
}
@@ -171,7 +171,7 @@ return olsr.olsrview.extend({
const rv = [];
for (let link of neigh_res) {
link.linkCost = (link.linkCost).toFixed(3) || 0;
if (link.linkCost === 4194304) {
if (link.linkCost == 4194304) {
link.linkCost = 0;
}
const color = etx_color(link.linkCost);
@@ -25,7 +25,7 @@ return olsr.olsrview.extend({
if (a.proto === b.proto) {
return a.rtpMetricCost < b.rtpMetricCost;
} else {
return a.proto < b.proto;
return a.proto < b.proto ? -1 : a.proto > b.proto ? 1 : 0;
}
}
let modifiedData;
@@ -22,7 +22,7 @@ return olsr.olsrview.extend({
if (a.proto === b.proto) {
return a.tcEdgeCost < b.tcEdgeCost;
} else {
return a.proto < b.proto;
return a.proto < b.proto ? -1 : a.proto > b.proto ? 1 : 0;
}
}