From c981cfd02a53dec99a39a42b8771934c0885fd11 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Antoine=20Desch=C3=AAnes?= Date: Sat, 24 Aug 2019 15:48:07 -0400 Subject: [PATCH] luci-mod-network: wifi_join.js: Add WPA3 support MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Antoine Deschênes [squashed commits, cherry-picked into openwrt-19.07 branch] Signed-off-by: Jo-Philipp Wich --- .../resources/view/network/wifi_join.js | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wifi_join.js b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wifi_join.js index d5bd7b0a6..e94fd467b 100644 --- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wifi_join.js +++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wifi_join.js @@ -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) { -- 2.25.1