luci-mod-network: don't offer unsupported wireless hwmodes

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>
This commit is contained in:
Andre Heider 2022-11-26 13:30:26 +01:00
parent 05f2901ffb
commit eead21c5ab

View file

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