diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-02-13 23:50:15 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-02-13 23:50:15 +0100 |
commit | a1cdbfc59a1212b585a4ea3dca49c189c360a8e5 (patch) | |
tree | 09161af1d69b6dfa9987604864dc2a03c195f314 /luci2 | |
parent | 6c317248bae87fb7e9edeba351d328907f346cc4 (diff) | |
download | luci2-ui-a1cdbfc59a1212b585a4ea3dca49c189c360a8e5.tar.gz |
luci2.wireless: support condensed output in formatEncryption()
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'luci2')
-rw-r--r-- | luci2/htdocs/luci2/wireless.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/luci2/htdocs/luci2/wireless.js b/luci2/htdocs/luci2/wireless.js index c724f85..4d7892a 100644 --- a/luci2/htdocs/luci2/wireless.js +++ b/luci2/htdocs/luci2/wireless.js @@ -129,7 +129,7 @@ Class.extend({ }); }, - formatEncryption: function(enc) + formatEncryption: function(enc, condensed) { var format_list = function(l, s) { @@ -144,7 +144,9 @@ Class.extend({ if (enc.wep) { - if (enc.wep.length == 2) + if (condensed) + return L.tr('WEP'); + else if (enc.wep.length == 2) return L.tr('WEP Open/Shared') + ' (%s)'.format(format_list(enc.ciphers, ', ')); else if (enc.wep[0] == 'shared') return L.tr('WEP Shared Auth') + ' (%s)'.format(format_list(enc.ciphers, ', ')); @@ -153,7 +155,11 @@ Class.extend({ } else if (enc.wpa) { - if (enc.wpa.length == 2) + if (condensed && enc.wpa.length == 2) + return L.tr('WPA mixed'); + else if (condensed) + return (enc.wpa[0] == 2) ? L.tr('WPA2') : L.tr('WPA'); + else if (enc.wpa.length == 2) return L.tr('mixed WPA/WPA2') + ' %s (%s)'.format( format_list(enc.authentication, '/'), format_list(enc.ciphers, ', ') |