luci-app-olsr: correctness fixes
authorPaul Donald <redacted>
Fri, 22 May 2026 11:32:21 +0000 (14:32 +0300)
committerPaul Donald <redacted>
Wed, 27 May 2026 12:49:45 +0000 (15:49 +0300)
Signed-off-by: Paul Donald <redacted>
applications/luci-app-olsr/htdocs/luci-static/resources/olsr/common_js.js
applications/luci-app-olsr/htdocs/luci-static/resources/view/olsr/status-olsr/hna.js
applications/luci-app-olsr/htdocs/luci-static/resources/view/olsr/status-olsr/neighbors.js
applications/luci-app-olsr/htdocs/luci-static/resources/view/olsr/status-olsr/routes.js
applications/luci-app-olsr/htdocs/luci-static/resources/view/olsr/status-olsr/topology.js

index 81a78435a6c87a7c82fe0ebf4d1c9f6c1da565a6..b1514d9101404ed1fcb1a96fae7772f03d33175c 100644 (file)
@@ -153,5 +153,7 @@ const olsrview = view.extend({
 
 return L.Class.extend({
        olsrview: olsrview,
+       etx_color: etx_color,
+       snr_colors: snr_colors,
 
 });
\ No newline at end of file
index db7e1a85d952e128aad4c74412bfdd55291dcd5d..4ad87ed2256e839570d1217e038c8eefe5eb4d88 100644 (file)
@@ -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;
index 3d315cf91e37b1d381aa72f232572e509eeac783..97c3b238def79debb4728d7f3155d90f2eb583a2 100644 (file)
@@ -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);
index 36457d3b82c32b2af68ca1d3914fcb07bc6418c2..6d6e383481eae55e398cc8f204dc2d87218fe0e5 100644 (file)
@@ -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;
index c8d927356e485183d0037bf25e77c9974b3cbe09..f2e38747b708167595c849b8522cf7b58ede4e86 100644 (file)
@@ -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;
                                                }
                                        }
 
git clone https://git.99rst.org/PROJECT