diff options
6 files changed, 107 insertions, 22 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index b6b996818a..c504279eeb 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -3371,6 +3371,7 @@ WifiDevice = baseclass.extend(/** @lends LuCI.network.WifiDevice.prototype */ { * - `n` - IEEE 802.11n mode, 2.4 or 5 GHz, up to 600 Mbit/s * - `ac` - IEEE 802.11ac mode, 5 GHz, up to 6770 Mbit/s * - `ax` - IEEE 802.11ax mode, 2.4 or 5 GHz + * - 'be' - IEEE 802.11be mode, 2.4, 5 or 6 GHz */ getHWModes: function() { var hwmodes = this.ubus('dev', 'iwinfo', 'hwmodes'); @@ -3396,6 +3397,11 @@ WifiDevice = baseclass.extend(/** @lends LuCI.network.WifiDevice.prototype */ { * - `HE40` - applicable to IEEE 802.11ax, 40 MHz wide channels * - `HE80` - applicable to IEEE 802.11ax, 80 MHz wide channels * - `HE160` - applicable to IEEE 802.11ax, 160 MHz wide channels + * - `EHT20` - applicable to IEEE 802.11be, 20 MHz wide channels + * - `EHT40` - applicable to IEEE 802.11be, 40 MHz wide channels + * - `EHT80` - applicable to IEEE 802.11be, 80 MHz wide channels + * - `EHT160` - applicable to IEEE 802.11be, 160 MHz wide channels + * - `EHT320` - applicable to IEEE 802.11be, 320 MHz wide channels */ getHTModes: function() { var htmodes = this.ubus('dev', 'iwinfo', 'htmodes'); @@ -4101,6 +4107,17 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */ * @property {number} [he_dcm] * Specifies whether dual concurrent modulation is used for the transmission. * Only applicable to HE rates. + * + * @property {boolean} [eht] + * Specifies whether this rate is an EHT (IEEE 802.11be) rate. + * + * @property {number} [eht_gi] + * Specifies whether the guard interval used for the transmission. + * Only applicable to EHT rates. + * + * @property {number} [eht_dcm] + * Specifies whether dual concurrent modulation is used for the transmission. + * Only applicable to EHT rates. */ /** diff --git a/modules/luci-base/root/usr/share/rpcd/ucode/luci b/modules/luci-base/root/usr/share/rpcd/ucode/luci index 93ce1dd3b9..9bb8bb88c7 100644 --- a/modules/luci-base/root/usr/share/rpcd/ucode/luci +++ b/modules/luci-base/root/usr/share/rpcd/ucode/luci @@ -208,7 +208,7 @@ const methods = { relayd: access('/usr/sbin/relayd') == true, }; - const wifi_features = [ 'eap', '11ac', '11ax', '11r', 'acs', 'sae', 'owe', 'suiteb192', 'wep', 'wps', 'ocv' ]; + const wifi_features = [ 'eap', '11ac', '11ax', '11be', '11r', 'acs', 'sae', 'owe', 'suiteb192', 'wep', 'wps', 'ocv' ]; if (access('/usr/sbin/hostapd')) { result.hostapd = { cli: access('/usr/sbin/hostapd_cli') == true }; diff --git a/modules/luci-compat/luasrc/view/cbi/wireless_modefreq.htm b/modules/luci-compat/luasrc/view/cbi/wireless_modefreq.htm index eeb1d5c5cb..f81ee19614 100644 --- a/modules/luci-compat/luasrc/view/cbi/wireless_modefreq.htm +++ b/modules/luci-compat/luasrc/view/cbi/wireless_modefreq.htm @@ -29,7 +29,9 @@ var modes = [ '', 'Legacy', true, 'n', 'N', hwmodes.n, - 'ac', 'AC', hwmodes.ac + 'ac', 'AC', hwmodes.ac, + 'ax', 'AX', hwmodes.ax, + 'be', 'BE', hwmodes.be ]; var htmodes = { @@ -45,6 +47,19 @@ 'VHT40', '40 MHz', htmodes.VHT40, 'VHT80', '80 MHz', htmodes.VHT80, 'VHT160', '160 MHz', htmodes.VHT160 + ], + 'ax': [ + 'HE20', '20 MHz', htmodes.HE20, + 'HE40', '40 MHz', htmodes.HE40, + 'HE80', '80 MHz', htmodes.HE80, + 'HE160', '160 MHz', htmodes.HE160 + ], + 'be': [ + 'EHT20', '20 MHz', htmodes.EHT20, + 'EHT40', '40 MHz', htmodes.EHT40, + 'EHT80', '80 MHz', htmodes.EHT80, + 'EHT160', '160 MHz', htmodes.EHT160, + 'EHT320', '320 MHz', htmodes.EHT320 ] }; @@ -59,7 +74,16 @@ ], 'ac': [ '11a', '5 GHz', true - ] + ], + 'ax': [ + '11a', '2 GHz', true, + '11a', '5 GHz', true + ], + 'be': [ + '11a', '2 GHz', true, + '11a', '5 GHz', true, + '11a', '6 GHz', true + ] }; function cbi_set_values(sel, vals) @@ -129,7 +153,11 @@ cbi_set_values(mode, modes); - if (/VHT20|VHT40|VHT80|VHT160/.test(<%= luci.http.write_json(self.map:get(section, "htmode")) %>)) + if (/EHT20|EHT40|EHT80|EHT160|EHT320/.test(<%= luci.http.write_json(self.map:get(section, "htmode")) %>)) + mode.value = 'be'; + else if (/HE20|HE40|HE80|HE160/.test(<%= luci.http.write_json(self.map:get(section, "htmode")) %>)) + mode.value = 'ax'; + else if (/VHT20|VHT40|VHT80|VHT160/.test(<%= luci.http.write_json(self.map:get(section, "htmode")) %>)) mode.value = 'ac'; else if (/HT20|HT40/.test(<%= luci.http.write_json(self.map:get(section, "htmode")) %>)) mode.value = 'n'; diff --git a/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js b/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js index 318c3abf87..e2742dd020 100644 --- a/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js +++ b/modules/luci-mod-dashboard/htdocs/luci-static/resources/view/dashboard/include/30_wifi.js @@ -60,7 +60,7 @@ return baseclass.extend({ continue; } - if ('actived' === idx) { + if ('isactive' === idx) { classname = radio[idx].value ? 'label label-success' : 'label label-danger'; radio[idx].value = radio[idx].value ? _('yes') : _('no'); } @@ -81,9 +81,9 @@ return baseclass.extend({ var container_devices = E('table', { 'class': 'table assoclist devices-info' }, [ E('tr', { 'class': 'tr table-titles dashboard-bg' }, [ E('th', { 'class': 'th nowrap' }, _('Hostname')), - E('th', { 'class': 'th' }, _('Wireless')), - E('th', { 'class': 'th' }, _('Signal')), - E('th', { 'class': 'th' }, '%s / %s'.format( _('Up.'), _('Down.'))) + E('th', { 'class': 'th' }, _('SSID')), + E('th', { 'class': 'th', 'width': '45%' }, _('Signal Strength')), + E('th', { 'class': 'th' }, 'Transferred %s / %s'.format( _('Up.'), _('Down.'))) ]) ]); @@ -104,11 +104,11 @@ return baseclass.extend({ if ('progress' == idx) { container_content = E('div', { 'class' : 'td device-info' }, [ - E('div', { 'class': 'progress' }, [ - E('div', { 'class': 'progress-bar ' + device[idx].value.style, role: 'progressbar', style: 'width:'+device[idx].value.qualite+'%', 'aria-valuenow': device[idx].value.qualite, 'aria-valuemin': 0, 'aria-valuemax': 100 }), + E('div', { 'class': 'cbi-progressbar', 'title': 'RSSI: ' + parseInt(device[idx].value.qualite) + '% (' + device[idx].value.rssi + 'dBm)' }, [ + E('div', { 'style': 'width: '+device[idx].value.qualite+'%'}), ]) ]); - } else if ('rate' == idx) { + } else if ('transferred' == idx) { container_content = E('td', { 'class': 'td device-info' }, [ E('p', {}, [ E('span', { 'class': ''}, [ device[idx].value.rx ]), @@ -159,7 +159,7 @@ return baseclass.extend({ value: net.getActiveSSID() || '?' }, - actived : { + isactive : { title: _('Active'), visible: true, value: !net.isDisabled() @@ -205,7 +205,8 @@ return baseclass.extend({ name = hosthints.getHostnameByMACAddr(bss.mac); var progress_style; - var q = Math.min((bss.signal + 110) / 70 * 100, 100); + // var q = Math.min((bss.signal + 110) / 70 * 100, 100); + var q = 100 * ((bss.signal - bss.noise) / (-30 - bss.noise)); if (q == 0 || q < 25) progress_style = 'bg-danger'; @@ -231,16 +232,17 @@ return baseclass.extend({ }, progress : { - title: _('Channel'), + title: _('Strength'), visible: true, value: { qualite: q, + rssi: bss.signal, style: progress_style } }, - rate : { - title: _('Bitrate'), + transferred : { + title: _('Transferred'), visible: true, value: { rx: '%s'.format('%.2mB'.format(bss.rx.bytes)), diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js index db3bb8eaff..112f9436ae 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js @@ -1237,7 +1237,10 @@ return view.extend({ }; proto = s2.option(form.ListValue, 'proto', _('Protocol')); - proto.validate = name.validate; + proto.onchange = function(ev, section_id, value) { + var elem = name.getUIElement(section_id); + elem.triggerValidation(); + }; device = s2.option(widgets.DeviceSelect, 'device', _('Device')); device.noaliases = false; diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index cedf1675ff..2cce3ed46d 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -201,7 +201,9 @@ function format_wifirate(rate) { mhz = rate.mhz, nss = rate.nss, mcs = rate.mcs, sgi = rate.short_gi, he = rate.he, he_gi = rate.he_gi, - he_dcm = rate.he_dcm; + he_dcm = rate.he_dcm, + eht = rate?.eht ?? false, eht_gi = rate?.eht_gi ?? 0, + eht_dcm = rate?.eht_dcm ?? 0; if (ht || vht) { if (vht) s += ', VHT-MCS\xa0%d'.format(mcs); @@ -217,6 +219,13 @@ function format_wifirate(rate) { if (he_dcm) s += ', HE-DCM\xa0%d'.format(he_dcm); } + if (eht) { + s += ', EHT-MCS\xa0%d'.format(mcs); + if (nss) s += ', EHT-NSS\xa0%d'.format(nss); + if (eht_gi) s += ', EHT-GI\xa0%d'.format(eht_gi); + if (eht_dcm) s += ', EHT-DCM\xa0%d'.format(eht_dcm); + } + return s; } @@ -298,7 +307,9 @@ function add_dependency_permutations(o, deps) { o.depends(res[i]); } +// Define a class CBIWifiFrequencyValue that extends form.Value var CBIWifiFrequencyValue = form.Value.extend({ + // Declare an RPC method to get the frequency list for a given device callFrequencyList: rpc.declare({ object: 'iwinfo', method: 'freqlist', @@ -306,6 +317,7 @@ var CBIWifiFrequencyValue = form.Value.extend({ expect: { results: [] } }), + // Load method to fetch WiFi device details and frequency list load: function(section_id) { return Promise.all([ network.getWifiDevice(section_id), @@ -334,13 +346,16 @@ var CBIWifiFrequencyValue = form.Value.extend({ var hwmodelist = L.toArray(data[0] ? data[0].getHWModes() : null) .reduce(function(o, v) { o[v] = true; return o }, {}); + // Define supported modes this.modes = [ '', 'Legacy', hwmodelist.a || hwmodelist.b || hwmodelist.g, 'n', 'N', hwmodelist.n, 'ac', 'AC', L.hasSystemFeature('hostapd', '11ac') && hwmodelist.ac, - 'ax', 'AX', L.hasSystemFeature('hostapd', '11ax') && hwmodelist.ax + 'ax', 'AX', L.hasSystemFeature('hostapd', '11ax') && hwmodelist.ax, + 'be', 'BE', L.hasSystemFeature('hostapd', '11be') && hwmodelist.be ]; + // Create a list of HT modes based on device capabilities var htmodelist = L.toArray(data[0] ? data[0].getHTModes() : null) .reduce(function(o, v) { o[v] = true; return o }, {}); @@ -361,9 +376,18 @@ var CBIWifiFrequencyValue = form.Value.extend({ 'HE40', '40 MHz', htmodelist.HE40, 'HE80', '80 MHz', htmodelist.HE80, 'HE160', '160 MHz', htmodelist.HE160 + ], + 'be': [ + 'EHT20', '20 MHz', htmodelist.EHT20, + 'EHT40', '40 MHz', htmodelist.EHT40, + 'EHT80', '80 MHz', htmodelist.EHT80, + 'EHT160', '160 MHz', htmodelist.EHT160, + 'EHT320', '320 MHz', htmodelist.EHT320 ] }; + // Define available bands for widget selection based on channel availability + // AX and BE are available on 2/5/6G bands this.bands = { '': [ '2g', '2.4 GHz', this.channels['2g'].length > 3, @@ -381,11 +405,17 @@ var CBIWifiFrequencyValue = form.Value.extend({ '2g', '2.4 GHz', this.channels['2g'].length > 3, '5g', '5 GHz', this.channels['5g'].length > 3, '6g', '6 GHz', this.channels['6g'].length > 3 - ] + ], + 'be': [ + '2g', '2.4 GHz', this.channels['2g'].length > 3, + '5g', '5 GHz', this.channels['5g'].length > 3, + '6g', '6 GHz', this.channels['6g'].length > 3 + ], }; }, this)); }, + // Set values in the select element setValues: function(sel, vals) { if (sel.vals) sel.vals.selected = sel.selectedIndex; @@ -445,7 +475,10 @@ var CBIWifiFrequencyValue = form.Value.extend({ this.setValues(mode, this.modes); - if (/HE20|HE40|HE80|HE160/.test(htval)) + // Determine mode based on htmode value + if (/EHT20|EHT40|EHT80|EHT160|EHT320/.test(htval)) + mode.value = 'be'; + else if (/HE20|HE40|HE80|HE160/.test(htval)) mode.value = 'ax'; else if (/VHT20|VHT40|VHT80|VHT160/.test(htval)) mode.value = 'ac'; @@ -459,7 +492,9 @@ var CBIWifiFrequencyValue = form.Value.extend({ if (hwval != null) { this.useBandOption = false; - if (/a/.test(hwval)) + if (/be/.test(mode.value)) + band.value = '6g'; + else if (/ax/.test(mode.value)) band.value = '5g'; else band.value = '2g'; |