luci-app-travelmate fixed
[project/luci.git] / applications / luci-app-travelmate / luasrc / view / travelmate / wifi_scan.htm
index 68ca63f..a8f63a1 100644 (file)
@@ -7,7 +7,8 @@ This is free software, licensed under the Apache License, Version 2.0
     local sys = require("luci.sys")
     local utl = require("luci.util")
     local dev = luci.http.formvalue("device")
-    local iw = luci.sys.wifi.getiwinfo(dev)
+    local iw  = luci.sys.wifi.getiwinfo(dev)
+    local wpa_label = {translate("WPA"), translate("WPA2"), translate("WPA/WPA2")}
 
     if not iw then
         luci.http.redirect(luci.dispatcher.build_url("admin/services/travelmate/stations"))
@@ -17,7 +18,7 @@ This is free software, licensed under the Apache License, Version 2.0
         if info.wep == true then
             return translate("WEP")
         elseif info.wpa > 0 then
-            return translate("WPA/WPA2 - " .. table.concat(info.auth_suites))
+            return "%s (%s/%s)" %{wpa_label[info.wpa], table.concat(info.auth_suites), table.concat(info.group_ciphers)}
         elseif info.enabled then
             return translate("Unknown")
         else
@@ -70,9 +71,9 @@ This is free software, licensed under the Apache License, Version 2.0
                         <input type="hidden" name="bssid" value="<%=utl.pcdata(net.bssid)%>"/>
                         <input type="hidden" name="wep" value="<%=net.encryption.wep and 1 or 0%>"/>
                         <% if net.encryption.wpa then %>
-                        <input type="hidden" name="wpa_version" value="<%=net.encryption.wpa%>"/>
-                        <% for _, v in ipairs(net.encryption.auth_suites) do %><input type="hidden" name="wpa_suites" value="<%=v%>"/>
-                        <% end; end %>
+                            <input type="hidden" name="wpa_version" value="<%=net.encryption.wpa%>"/>
+                            <% for _, v in ipairs(net.encryption.auth_suites) do %><input type="hidden" name="wpa_suites" value="<%=v%>"/><% end %>
+                        <% end %>
                         <input class="cbi-button cbi-button-apply" type="submit" value="<%:Add Uplink%>"/>
                     </form>
                 </td>