luci-mod-network: dynamically find mode and bssid positions
authorPaul Donald <[email protected]>
Mon, 3 Nov 2025 21:34:08 +0000 (22:34 +0100)
committerPaul Donald <[email protected]>
Mon, 3 Nov 2025 21:46:43 +0000 (22:46 +0100)
Dynamically find the mode and bssid position assignments in case their position
should change later.

Signed-off-by: Paul Donald <[email protected]>
(cherry picked from commit fd96244e7977c4fb3dc410957f5d634f8561ce05)

modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js

index 6a5a029e5aa55136a7cd5a73d86a849ebdea50c0..88ebec21252340825481beeb3a75607e504a18fe 100644 (file)
@@ -1128,8 +1128,8 @@ return view.extend({
 
                                let encr;
                                if (hwtype == 'mac80211') {
-                                       const mode = ss.children[0];
-                                       const bssid = ss.children[5];
+                                       const mode = ss.children.find(obj => obj.option === 'mode');
+                                       const bssid = ss.children.find(obj => obj.option === 'bssid');
 
                                        if (have_mesh) mode.value('mesh', '802.11s');
                                        mode.value('ahdemo', _('Pseudo Ad-Hoc (ahdemo)'));