luci-mod-network: don't offer unsupported wireless hwmodes
authorAndre Heider <a.heider@gmail.com>
Sat, 26 Nov 2022 12:30:26 +0000 (13:30 +0100)
committerAndre Heider <a.heider@gmail.com>
Mon, 23 Jan 2023 13:51:28 +0000 (14:51 +0100)
This prevents offering e.g. 'Legacy' on ac/n only radios or
ax if hostapd wasn't compiled with ax support.

Signed-off-by: Andre Heider <a.heider@gmail.com>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js

index bdeaecf8a9442aab0fe76b3c2b58d880948c20c6..e9b0fa41606577c5720b47f0cec2c01ff95a9b8a 100644 (file)
@@ -343,10 +343,10 @@ var CBIWifiFrequencyValue = form.Value.extend({
                                .reduce(function(o, v) { o[v] = true; return o }, {});
 
                        this.modes = [
-                               '', 'Legacy', true,
+                               '', 'Legacy', hwmodelist.a || hwmodelist.b || hwmodelist.g,
                                'n', 'N', hwmodelist.n,
-                               'ac', 'AC', hwmodelist.ac,
-                               'ax', 'AX', hwmodelist.ax
+                               'ac', 'AC', L.hasSystemFeature('hostapd', '11ac') && hwmodelist.ac,
+                               'ax', 'AX', L.hasSystemFeature('hostapd', '11ax') && hwmodelist.ax
                        ];
 
                        var htmodelist = L.toArray(data[0] ? data[0].getHTModes() : null)