luci-mod-network: wifi_join.js: Add WPA3 support

Signed-off-by: Antoine Deschênes <antoine@antoinedeschenes.com>
[squashed commits, cherry-picked into openwrt-19.07 branch]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Antoine Deschênes 2019-08-24 15:48:07 -04:00 committed by Jo-Philipp Wich
parent 1f6d7fdc10
commit c981cfd02a

View file

@ -29,21 +29,39 @@ function format_signal(bss) {
}
function format_encryption(bss) {
var enc = bss.encryption || { }
var enc = bss.encryption || {};
var WPA = 1, WPA2 = 2, WPA3 = 4;
var wpa_label;
if (enc.wep === true)
return 'WEP';
else if (enc.wpa > 0)
else if (enc.wpa > 0) {
switch (enc.wpa) {
case WPA2|WPA3:
wpa_label = _('mixed WPA2/WPA3');
break;
case WPA3:
wpa_label = _('WPA3');
break;
case WPA|WPA2:
wpa_label = _('mixed WPA/WPA2');
break;
case WPA2:
wpa_label = _('WPA2');
break;
default:
wpa_label = _('WPA');
}
return E('abbr', {
title: 'Pairwise: %h / Group: %h'.format(
enc.pair_ciphers.join(', '),
enc.group_ciphers.join(', '))
},
'%h - %h'.format(
(enc.wpa === 3) ? _('mixed WPA/WPA2') : (enc.wpa === 2 ? 'WPA2' : 'WPA'),
enc.auth_suites.join(', ')));
else
return E('em', enc.enabled ? _('unknown') : _('open'));
},
'%h - %h'.format(wpa_label, enc.auth_suites.join(', ')));
}
return E('em', enc.enabled ? _('unknown') : _('open'));
}
function format_actions(dev, type, bss) {