From: Jo-Philipp Wich Date: Fri, 13 Feb 2015 22:50:15 +0000 (+0100) Subject: luci2.wireless: support condensed output in formatEncryption() X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci2%2Fui.git;a=commitdiff_plain;h=a1cdbfc59a1212b585a4ea3dca49c189c360a8e5 luci2.wireless: support condensed output in formatEncryption() Signed-off-by: Jo-Philipp Wich --- 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, ', ')