luci-mod-dashboard: correctness fixes
authorPaul Donald <redacted>
Mon, 25 May 2026 22:42:01 +0000 (01:42 +0300)
committerPaul Donald <redacted>
Wed, 27 May 2026 12:49:46 +0000 (15:49 +0300)
Signed-off-by: Paul Donald <redacted>
modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/10_router.js
modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js
modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/index.js

index 6a06edf53101e3c7242a3f6564e5cb68c0020854..ef01c460f28e7d99317c5e90c487ee3bb2c74d88 100644 (file)
@@ -116,9 +116,7 @@ return baseclass.extend({
                                                if ('addrsv4' === ver) {
                                                        const addrs = data[idx][ver].value;
                                                        if(Array.isArray(addrs) && addrs.length) {
-                                                               for(let ip in addrs) {
-                                                                       data[idx][ver].value = addrs[ip].split('/')[0];
-                                                               }
+                                                               data[idx][ver].value = addrs.map(a => a.split('/')[0]);
                                                        }
                                                }
 
index 03ef838d47284940f9600ecec8de73b710505d58..bc52918482e44d5dfadce1265ccb85ed14ea7007 100644 (file)
@@ -20,7 +20,7 @@ return baseclass.extend({
 
                        for (let i = 0; i < radios_networks_hints[1].length; i++)
                                tasks.push(L.resolveDefault(radios_networks_hints[1][i].getAssocList(), []).then(L.bind((net, list) => {
-                                       net.assoclist = list.sort((a, b) => { return a.mac > b.mac });
+                                       net.assoclist = list.sort((a, b) => a.mac.localeCompare(b.mac));
                                }, this, radios_networks_hints[1][i])));
 
                        return Promise.all(tasks).then(() => {
@@ -138,7 +138,7 @@ return baseclass.extend({
 
        renderUpdateData(radios, networks, hosthints) {
 
-               for (let i = 0; i < radios.sort((a, b) => { a.getName() > b.getName() }).length; i++) {
+               for (let i = 0; i < radios.sort((a, b) => a.getName().localeCompare(b.getName())).length; i++) {
                        const network_items = networks.filter(net => { return net.getWifiDeviceName() == radios[i].getName() });
 
                        for (let j = 0; j < network_items.length; j++) {
index 6e9d8599b2bd06a46a13c47fe835d8f84aea05c0..83a34b028b25e3cb4334033bcf605cf0ae9a67e3 100644 (file)
@@ -17,9 +17,9 @@ function invokeIncludesLoad(includes) {
 
        for (let i = 0; i < includes.length; i++) {
                if (typeof(includes[i].load) == 'function') {
-                       tasks.push(includes[i].load().catch(L.bind(() => {
+                       tasks.push(includes[i].load().catch(function() {
                                this.failed = true;
-                       }includes[i])));
+                       }.bind(includes[i])));
 
                        has_load = true;
                }
git clone https://git.99rst.org/PROJECT