luci-mod-network: enable configuring wifi ax networks on the 6G band
[project/luci.git] / modules / luci-mod-network / htdocs / luci-static / resources / view / network / wireless.js
index 16ed918724798d52b8a1f867f34d11ae7f0c1cc6..3c6f51afeb2afce0a1695c416cebaf0de99cdbad 100644 (file)
@@ -314,7 +314,7 @@ var CBIWifiFrequencyValue = form.Value.extend({
                        this.channels = {
                                '2g': L.hasSystemFeature('hostapd', 'acs') ? [ 'auto', 'auto', true ] : [],
                                '5g': L.hasSystemFeature('hostapd', 'acs') ? [ 'auto', 'auto', true ] : [],
-                               '6g': [],
+                               '6g': L.hasSystemFeature('hostapd', 'acs') ? [ 'auto', 'auto', true ] : [],
                                '60g': []
                        };
 
@@ -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)
@@ -387,7 +387,8 @@ var CBIWifiFrequencyValue = form.Value.extend({
                                ],
                                'ax': [
                                        '2g', '2.4 GHz', this.channels['2g'].length > 3,
-                                       '5g', '5 GHz', this.channels['5g'].length > 3
+                                       '5g', '5 GHz', this.channels['5g'].length > 3,
+                                       '6g', '6 GHz', this.channels['6g'].length > 3
                                ]
                        };
                }, this));
@@ -1159,6 +1160,7 @@ return view.extend({
 
                                        o = ss.taboption('advanced', form.Value, 'ifname', _('Interface name'), _('Override default interface name'));
                                        o.optional = true;
+                                       o.datatype = 'maxlength(15)';
                                        o.placeholder = radioNet.getIfname();
                                        if (/^radio\d+\.network/.test(o.placeholder))
                                                o.placeholder = '';
@@ -1438,6 +1440,38 @@ return view.extend({
                                o.rmempty = true;
                                o.password = true;
 
+                               /* extra RADIUS settings start */
+                               o = ss.taboption('encryption', form.ListValue, 'dynamic_vlan', _('RADIUS Dynamic VLAN Assignment'), _('Required: Rejects auth if RADIUS server does not provide appropriate VLAN attributes.'));
+                               add_dependency_permutations(o, { mode: ['ap', 'ap-wds'], encryption: ['wpa', 'wpa2', 'wpa3', 'wpa3-mixed'] });
+                               o.value('0', _('Disabled'));
+                               o.value('1', _('Optional'));
+                               o.value('2', _('Required'));
+                               o.write = function (section_id, value) {
+                                       return this.super('write', [section_id, (value == 0) ? null: value]);
+                               }
+
+                               o = ss.taboption('encryption', form.Flag, 'per_sta_vif', _('RADIUS Per STA VLAN'), _('Each STA is assigned its own AP_VLAN interface.'));
+                               add_dependency_permutations(o, { mode: ['ap', 'ap-wds'], encryption: ['wpa', 'wpa2', 'wpa3', 'wpa3-mixed'] });
+
+                               //hostapd internally defaults to vlan_naming=1 even with dynamic VLAN off
+                               o = ss.taboption('encryption', form.Flag, 'vlan_naming', _('RADIUS VLAN Naming'), _('Off: <code>vlanXXX</code>, e.g., <code>vlan1</code>. On: <code>vlan_tagged_interface.XXX</code>, e.g. <code>eth0.1</code>.'));
+                               add_dependency_permutations(o, { mode: ['ap', 'ap-wds'], encryption: ['wpa', 'wpa2', 'wpa3', 'wpa3-mixed'] });
+
+                               o = ss.taboption('encryption', widgets.DeviceSelect, 'vlan_tagged_interface', _('RADIUS VLAN Tagged Interface'), _('E.g. eth0, eth1'));
+                               add_dependency_permutations(o, { mode: ['ap', 'ap-wds'], encryption: ['wpa', 'wpa2', 'wpa3', 'wpa3-mixed'] });
+                               o.size = 1;
+                               o.rmempty = true;
+                               o.multiple = false;
+                               o.noaliases = true;
+                               o.nobridges = true;
+                               o.nocreate = true;
+                               o.noinactive = true;
+
+                               o = ss.taboption('encryption', form.Value, 'vlan_bridge', _('RADIUS VLAN Bridge Naming Scheme'), _('E.g. <code>br-vlan</code> or <code>brvlan</code>.'));
+                               add_dependency_permutations(o, { mode: ['ap', 'ap-wds'], encryption: ['wpa', 'wpa2', 'wpa3', 'wpa3-mixed'] });
+                               o.rmempty = true;
+                               /* extra RADIUS settings end */
+
                                o = ss.taboption('encryption', form.Value, 'dae_client', _('DAE-Client'), _('Dynamic Authorization Extension client.'));
                                add_dependency_permutations(o, { mode: ['ap', 'ap-wds'], encryption: ['wpa', 'wpa2', 'wpa3', 'wpa3-mixed'] });
                                o.rmempty = true;