mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Update luci-mod-network to upstream and add multipath and latency support
This commit is contained in:
parent
490133cea7
commit
94f2c90ad4
8 changed files with 1859 additions and 382 deletions
|
@ -199,7 +199,9 @@ function format_wifirate(rate) {
|
|||
var s = '%.1f\xa0%s, %d\xa0%s'.format(rate.rate / 1000, _('Mbit/s'), rate.mhz, _('MHz')),
|
||||
ht = rate.ht, vht = rate.vht,
|
||||
mhz = rate.mhz, nss = rate.nss,
|
||||
mcs = rate.mcs, sgi = rate.short_gi;
|
||||
mcs = rate.mcs, sgi = rate.short_gi,
|
||||
he = rate.he, he_gi = rate.he_gi,
|
||||
he_dcm = rate.he_dcm;
|
||||
|
||||
if (ht || vht) {
|
||||
if (vht) s += ', VHT-MCS\xa0%d'.format(mcs);
|
||||
|
@ -208,6 +210,13 @@ function format_wifirate(rate) {
|
|||
if (sgi) s += ', ' + _('Short GI').replace(/ /g, '\xa0');
|
||||
}
|
||||
|
||||
if (he) {
|
||||
s += ', HE-MCS\xa0%d'.format(mcs);
|
||||
if (nss) s += ', HE-NSS\xa0%d'.format(nss);
|
||||
if (he_gi) s += ', HE-GI\xa0%d'.format(he_gi);
|
||||
if (he_dcm) s += ', HE-DCM\xa0%d'.format(he_dcm);
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
@ -303,16 +312,32 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
|||
this.callFrequencyList(section_id)
|
||||
]).then(L.bind(function(data) {
|
||||
this.channels = {
|
||||
'11g': L.hasSystemFeature('hostapd', 'acs') ? [ 'auto', 'auto', true ] : [],
|
||||
'11a': L.hasSystemFeature('hostapd', 'acs') ? [ 'auto', 'auto', true ] : []
|
||||
'2g': L.hasSystemFeature('hostapd', 'acs') ? [ 'auto', 'auto', true ] : [],
|
||||
'5g': L.hasSystemFeature('hostapd', 'acs') ? [ 'auto', 'auto', true ] : [],
|
||||
'6g': [],
|
||||
'60g': []
|
||||
};
|
||||
|
||||
for (var i = 0; i < data[1].length; i++)
|
||||
this.channels[(data[1][i].mhz > 2484) ? '11a' : '11g'].push(
|
||||
for (var i = 0; i < data[1].length; i++) {
|
||||
var band;
|
||||
|
||||
if (data[1][i].mhz >= 2412 && data[1][i].mhz <= 2484)
|
||||
band = '2g';
|
||||
else if (data[1][i].mhz >= 5160 && data[1][i].mhz <= 5885)
|
||||
band = '5g';
|
||||
else if (data[1][i].mhz >= 5925 && data[1][i].mhz <= 7125)
|
||||
band = '6g';
|
||||
else if (data[1][i].mhz >= 58329 && data[1][i].mhz <= 69120)
|
||||
band = '60g';
|
||||
else
|
||||
continue;
|
||||
|
||||
this.channels[band].push(
|
||||
data[1][i].channel,
|
||||
'%d (%d Mhz)'.format(data[1][i].channel, data[1][i].mhz),
|
||||
!data[1][i].restricted
|
||||
);
|
||||
}
|
||||
|
||||
var hwmodelist = L.toArray(data[0] ? data[0].getHWModes() : null)
|
||||
.reduce(function(o, v) { o[v] = true; return o }, {});
|
||||
|
@ -320,7 +345,8 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
|||
this.modes = [
|
||||
'', 'Legacy', true,
|
||||
'n', 'N', hwmodelist.n,
|
||||
'ac', 'AC', hwmodelist.ac
|
||||
'ac', 'AC', hwmodelist.ac,
|
||||
'ax', 'AX', hwmodelist.ax
|
||||
];
|
||||
|
||||
var htmodelist = L.toArray(data[0] ? data[0].getHTModes() : null)
|
||||
|
@ -337,20 +363,30 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
|||
'VHT40', '40 MHz', htmodelist.VHT40,
|
||||
'VHT80', '80 MHz', htmodelist.VHT80,
|
||||
'VHT160', '160 MHz', htmodelist.VHT160
|
||||
],
|
||||
'ax': [
|
||||
'HE20', '20 MHz', htmodelist.HE20,
|
||||
'HE40', '40 MHz', htmodelist.HE40,
|
||||
'HE80', '80 MHz', htmodelist.HE80,
|
||||
'HE160', '160 MHz', htmodelist.HE160
|
||||
]
|
||||
};
|
||||
|
||||
this.bands = {
|
||||
'': [
|
||||
'11g', '2.4 GHz', this.channels['11g'].length > 3,
|
||||
'11a', '5 GHz', this.channels['11a'].length > 3
|
||||
'2g', '2.4 GHz', this.channels['2g'].length > 3,
|
||||
'5g', '5 GHz', this.channels['5g'].length > 3
|
||||
],
|
||||
'n': [
|
||||
'11g', '2.4 GHz', this.channels['11g'].length > 3,
|
||||
'11a', '5 GHz', this.channels['11a'].length > 3
|
||||
'2g', '2.4 GHz', this.channels['2g'].length > 3,
|
||||
'5g', '5 GHz', this.channels['5g'].length > 3
|
||||
],
|
||||
'ac': [
|
||||
'11a', '5 GHz', true
|
||||
'5g', '5 GHz', true
|
||||
],
|
||||
'ax': [
|
||||
'2g', '2.4 GHz', this.channels['2g'].length > 3,
|
||||
'5g', '5 GHz', this.channels['5g'].length > 3
|
||||
]
|
||||
};
|
||||
}, this));
|
||||
|
@ -392,6 +428,8 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
|||
|
||||
this.setValues(band, this.bands[mode.value]);
|
||||
this.toggleWifiChannel(elem);
|
||||
|
||||
this.map.checkDepends();
|
||||
},
|
||||
|
||||
toggleWifiChannel: function(elem) {
|
||||
|
@ -408,11 +446,14 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
|||
bwdt = elem.querySelector('.htmode'),
|
||||
htval = uci.get('wireless', section_id, 'htmode'),
|
||||
hwval = uci.get('wireless', section_id, 'hwmode'),
|
||||
chval = uci.get('wireless', section_id, 'channel');
|
||||
chval = uci.get('wireless', section_id, 'channel'),
|
||||
bandval = uci.get('wireless', section_id, 'band');
|
||||
|
||||
this.setValues(mode, this.modes);
|
||||
|
||||
if (/VHT20|VHT40|VHT80|VHT160/.test(htval))
|
||||
if (/HE20|HE40|HE80|HE160/.test(htval))
|
||||
mode.value = 'ax';
|
||||
else if (/VHT20|VHT40|VHT80|VHT160/.test(htval))
|
||||
mode.value = 'ac';
|
||||
else if (/HT20|HT40/.test(htval))
|
||||
mode.value = 'n';
|
||||
|
@ -421,15 +462,24 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
|||
|
||||
this.toggleWifiMode(elem);
|
||||
|
||||
if (/a/.test(hwval))
|
||||
band.value = '11a';
|
||||
else
|
||||
band.value = '11g';
|
||||
if (hwval != null) {
|
||||
this.useBandOption = false;
|
||||
|
||||
if (/a/.test(hwval))
|
||||
band.value = '5g';
|
||||
else
|
||||
band.value = '2g';
|
||||
}
|
||||
else {
|
||||
this.useBandOption = true;
|
||||
|
||||
band.value = bandval;
|
||||
}
|
||||
|
||||
this.toggleWifiBand(elem);
|
||||
|
||||
bwdt.value = htval;
|
||||
chan.value = chval;
|
||||
chan.value = chval || chan.options[0].value;
|
||||
|
||||
return elem;
|
||||
},
|
||||
|
@ -461,6 +511,7 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
|||
E('select', {
|
||||
'class': 'channel',
|
||||
'style': 'width:auto',
|
||||
'change': L.bind(this.map.checkDepends, this.map),
|
||||
'disabled': (this.disabled != null) ? this.disabled : this.map.readonly
|
||||
})
|
||||
]),
|
||||
|
@ -469,6 +520,7 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
|||
E('select', {
|
||||
'class': 'htmode',
|
||||
'style': 'width:auto',
|
||||
'change': L.bind(this.map.checkDepends, this.map),
|
||||
'disabled': (this.disabled != null) ? this.disabled : this.map.readonly
|
||||
})
|
||||
]),
|
||||
|
@ -481,7 +533,7 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
|||
cfgvalue: function(section_id) {
|
||||
return [
|
||||
uci.get('wireless', section_id, 'htmode'),
|
||||
uci.get('wireless', section_id, 'hwmode'),
|
||||
uci.get('wireless', section_id, 'hwmode') || uci.get('wireless', section_id, 'band'),
|
||||
uci.get('wireless', section_id, 'channel')
|
||||
];
|
||||
},
|
||||
|
@ -498,7 +550,12 @@ var CBIWifiFrequencyValue = form.Value.extend({
|
|||
|
||||
write: function(section_id, value) {
|
||||
uci.set('wireless', section_id, 'htmode', value[0] || null);
|
||||
uci.set('wireless', section_id, 'hwmode', value[1]);
|
||||
|
||||
if (this.useBandOption)
|
||||
uci.set('wireless', section_id, 'band', value[1]);
|
||||
else
|
||||
uci.set('wireless', section_id, 'hwmode', (value[1] == '2g') ? '11g' : '11a');
|
||||
|
||||
uci.set('wireless', section_id, 'channel', value[2]);
|
||||
}
|
||||
});
|
||||
|
@ -883,6 +940,9 @@ return view.extend({
|
|||
o.ucisection = s.section;
|
||||
|
||||
if (hwtype == 'mac80211') {
|
||||
o = ss.taboption('general', form.Flag, 'legacy_rates', _('Allow legacy 802.11b rates'), _('Legacy or badly behaving devices may require legacy 802.11b rates to interoperate. Airtime efficiency may be significantly reduced where these are used. It is recommended to not allow 802.11b rates where possible.'));
|
||||
o.depends({'_freq': '11g', '!contains': true});
|
||||
|
||||
o = ss.taboption('general', CBIWifiTxPowerValue, 'txpower', _('Maximum transmit power'), _('Specifies the maximum transmit power the wireless radio may use. Depending on regulatory requirements and wireless usage, the actual transmit power may be reduced by the driver.'));
|
||||
o.wifiNetwork = radioNet;
|
||||
|
||||
|
@ -895,9 +955,6 @@ return view.extend({
|
|||
o.value('2', _('High'));
|
||||
o.value('3', _('Very High'));
|
||||
|
||||
o = ss.taboption('advanced', form.Flag, 'legacy_rates', _('Allow legacy 802.11b rates'));
|
||||
o.default = o.enabled;
|
||||
|
||||
o = ss.taboption('advanced', form.Value, 'distance', _('Distance Optimization'), _('Distance to farthest network member in meters.'));
|
||||
o.datatype = 'or(range(0,114750),"auto")';
|
||||
o.placeholder = 'auto';
|
||||
|
@ -983,8 +1040,17 @@ return view.extend({
|
|||
return net || network.addNetwork(name, { proto: 'none' });
|
||||
}, this, values[i])).then(L.bind(function(dev, net) {
|
||||
if (net) {
|
||||
if (!net.isEmpty())
|
||||
net.set('type', 'bridge');
|
||||
if (!net.isEmpty()) {
|
||||
var target_dev = net.getDevice();
|
||||
|
||||
/* Resolve parent interface of vlan */
|
||||
while (target_dev && target_dev.getType() == 'vlan')
|
||||
target_dev = target_dev.getParent();
|
||||
|
||||
if (!target_dev || target_dev.getType() != 'bridge')
|
||||
net.set('type', 'bridge');
|
||||
}
|
||||
|
||||
net.addDevice(dev);
|
||||
}
|
||||
}, this, dev)));
|
||||
|
@ -1014,7 +1080,7 @@ return view.extend({
|
|||
bssid.depends('mode', 'sta');
|
||||
bssid.depends('mode', 'sta-wds');
|
||||
|
||||
o = ss.taboption('macfilter', form.ListValue, 'macfilter', _('MAC-Address Filter'));
|
||||
o = ss.taboption('macfilter', form.ListValue, 'macfilter', _('MAC Address Filter'));
|
||||
o.depends('mode', 'ap');
|
||||
o.depends('mode', 'ap-wds');
|
||||
o.value('', _('disable'));
|
||||
|
@ -1069,11 +1135,11 @@ return view.extend({
|
|||
return mode;
|
||||
};
|
||||
|
||||
o = ss.taboption('general', form.Flag, 'hidden', _('Hide <abbr title="Extended Service Set Identifier">ESSID</abbr>'));
|
||||
o = ss.taboption('general', form.Flag, 'hidden', _('Hide <abbr title="Extended Service Set Identifier">ESSID</abbr>'), _('Where the ESSID is hidden, clients may fail to roam and airtime efficiency may be significantly reduced.'));
|
||||
o.depends('mode', 'ap');
|
||||
o.depends('mode', 'ap-wds');
|
||||
|
||||
o = ss.taboption('general', form.Flag, 'wmm', _('WMM Mode'));
|
||||
o = ss.taboption('general', form.Flag, 'wmm', _('WMM Mode'), _('Where Wi-Fi Multimedia (WMM) Mode QoS is disabled, clients may be limited to 802.11a/802.11g rates.'));
|
||||
o.depends('mode', 'ap');
|
||||
o.depends('mode', 'ap-wds');
|
||||
o.default = o.enabled;
|
||||
|
@ -1609,34 +1675,32 @@ return view.extend({
|
|||
|
||||
if (hwtype == 'mac80211') {
|
||||
// ieee802.11w options
|
||||
if (L.hasSystemFeature('hostapd', '11w')) {
|
||||
o = ss.taboption('encryption', form.ListValue, 'ieee80211w', _('802.11w Management Frame Protection'), _("Requires the 'full' version of wpad/hostapd and support from the wifi driver <br />(as of Jan 2019: ath9k, ath10k, mwlwifi and mt76)"));
|
||||
o.value('', _('Disabled'));
|
||||
o.value('1', _('Optional'));
|
||||
o.value('2', _('Required'));
|
||||
add_dependency_permutations(o, { mode: ['ap', 'ap-wds', 'sta', 'sta-wds'], encryption: ['owe', 'psk2', 'psk-mixed', 'sae', 'sae-mixed', 'wpa2', 'wpa3', 'wpa3-mixed'] });
|
||||
o = ss.taboption('encryption', form.ListValue, 'ieee80211w', _('802.11w Management Frame Protection'), _("Note: Some wireless drivers do not fully support 802.11w. E.g. mwlwifi may have problems"));
|
||||
o.value('', _('Disabled'));
|
||||
o.value('1', _('Optional'));
|
||||
o.value('2', _('Required'));
|
||||
add_dependency_permutations(o, { mode: ['ap', 'ap-wds', 'sta', 'sta-wds'], encryption: ['owe', 'psk2', 'psk-mixed', 'sae', 'sae-mixed', 'wpa2', 'wpa3', 'wpa3-mixed'] });
|
||||
|
||||
o.defaults = {
|
||||
'2': [{ encryption: 'sae' }, { encryption: 'owe' }, { encryption: 'wpa3' }, { encryption: 'wpa3-mixed' }],
|
||||
'1': [{ encryption: 'sae-mixed'}],
|
||||
'': []
|
||||
};
|
||||
|
||||
o = ss.taboption('encryption', form.Value, 'ieee80211w_max_timeout', _('802.11w maximum timeout'), _('802.11w Association SA Query maximum timeout'));
|
||||
o.depends('ieee80211w', '1');
|
||||
o.depends('ieee80211w', '2');
|
||||
o.datatype = 'uinteger';
|
||||
o.placeholder = '1000';
|
||||
o.rmempty = true;
|
||||
|
||||
o = ss.taboption('encryption', form.Value, 'ieee80211w_retry_timeout', _('802.11w retry timeout'), _('802.11w Association SA Query retry timeout'));
|
||||
o.depends('ieee80211w', '1');
|
||||
o.depends('ieee80211w', '2');
|
||||
o.datatype = 'uinteger';
|
||||
o.placeholder = '201';
|
||||
o.rmempty = true;
|
||||
o.defaults = {
|
||||
'2': [{ encryption: 'sae' }, { encryption: 'owe' }, { encryption: 'wpa3' }, { encryption: 'wpa3-mixed' }],
|
||||
'1': [{ encryption: 'sae-mixed'}],
|
||||
'': []
|
||||
};
|
||||
|
||||
o = ss.taboption('encryption', form.Value, 'ieee80211w_max_timeout', _('802.11w maximum timeout'), _('802.11w Association SA Query maximum timeout'));
|
||||
o.depends('ieee80211w', '1');
|
||||
o.depends('ieee80211w', '2');
|
||||
o.datatype = 'uinteger';
|
||||
o.placeholder = '1000';
|
||||
o.rmempty = true;
|
||||
|
||||
o = ss.taboption('encryption', form.Value, 'ieee80211w_retry_timeout', _('802.11w retry timeout'), _('802.11w Association SA Query retry timeout'));
|
||||
o.depends('ieee80211w', '1');
|
||||
o.depends('ieee80211w', '2');
|
||||
o.datatype = 'uinteger';
|
||||
o.placeholder = '201';
|
||||
o.rmempty = true;
|
||||
|
||||
o = ss.taboption('encryption', form.Flag, 'wpa_disable_eapol_key_retries', _('Enable key reinstallation (KRACK) countermeasures'), _('Complicates key reinstallation attacks on the client side by disabling retransmission of EAPOL-Key frames that are used to install keys. This workaround might cause interoperability issues and reduced robustness of key negotiation especially in environments with heavy traffic load.'));
|
||||
add_dependency_permutations(o, { mode: ['ap', 'ap-wds'], encryption: ['psk2', 'psk-mixed', 'sae', 'sae-mixed', 'wpa2', 'wpa3', 'wpa3-mixed'] });
|
||||
|
||||
|
@ -2082,7 +2146,7 @@ return view.extend({
|
|||
var table = E('table', { 'class': 'table assoclist', 'id': 'wifi_assoclist_table' }, [
|
||||
E('tr', { 'class': 'tr table-titles' }, [
|
||||
E('th', { 'class': 'th nowrap' }, _('Network')),
|
||||
E('th', { 'class': 'th hide-xs' }, _('MAC-Address')),
|
||||
E('th', { 'class': 'th hide-xs' }, _('MAC address')),
|
||||
E('th', { 'class': 'th' }, _('Host')),
|
||||
E('th', { 'class': 'th' }, _('Signal / Noise')),
|
||||
E('th', { 'class': 'th' }, _('RX Rate / TX Rate'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue