diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-09-26 14:00:23 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-09-26 14:00:23 +0000 |
commit | 64b6f98653d16f2baffd3c282e75d6129b9f9dee (patch) | |
tree | 95b54b49d5b2a66d92d3ff1723a2da88eedea9b0 /modules/admin-full/luasrc/view | |
parent | 93215e86d815584cf806e712664cb9bd5bf95af2 (diff) |
modules/admin-full: make wireless survey work on actual hardware, add a warning if wpa-supplicant is required but not installed, fix some typos
Diffstat (limited to 'modules/admin-full/luasrc/view')
3 files changed, 24 insertions, 8 deletions
diff --git a/modules/admin-full/luasrc/view/admin_network/wifi_join.htm b/modules/admin-full/luasrc/view/admin_network/wifi_join.htm index 3963a5ae28..ec776f6979 100644 --- a/modules/admin-full/luasrc/view/admin_network/wifi_join.htm +++ b/modules/admin-full/luasrc/view/admin_network/wifi_join.htm @@ -52,12 +52,12 @@ $Id$ function format_wifi_encryption(info) if info.wep == true and not info.wpa_version then return "WEP" - elseif info.wpa_version then + elseif info.wpa then return "<abbr title='Pairwise: %s / Group: %s'>%s - %s</abbr>" % { table.concat(info.pair_ciphers, ", "), table.concat(info.group_ciphers, ", "), - (info.wpa_version == 3) and "mixed WPA/WPA2" - or (info.wpa_version == 2 and "WPA2" or "WPA"), + (info.wpa == 3) and "mixed WPA/WPA2" + or (info.wpa == 2 and "WPA2" or "WPA"), table.concat(info.auth_suites, ", ") } else @@ -100,8 +100,8 @@ $Id$ <input type="hidden" name="bssid" value="<%=net.bssid%>" /> <input type="hidden" name="channel" value="<%=net.channel%>" /> <input type="hidden" name="wep" value="<%=net.wep and 1 or 0%>" /> - <% if net.wpa_version then %> - <input type="hidden" name="wpa_version" value="<%=net.wpa_version%>" /> + <% if net.wpa then %> + <input type="hidden" name="wpa_version" value="<%=net.wpa%>" /> <% for _, v in ipairs(net.auth_suites) do %><input type="hidden" name="wpa_suites" value="<%=v%>" /> <% end; for _, v in ipairs(net.group_ciphers) do %><input type="hidden" name="wpa_group" value="<%=v%>" /> <% end; for _, v in ipairs(net.pair_ciphers) do %><input type="hidden" name="wpa_pairwise" value="<%=v%>" /> diff --git a/modules/admin-full/luasrc/view/admin_network/wifi_join_settings.htm b/modules/admin-full/luasrc/view/admin_network/wifi_join_settings.htm index c914f3eddb..1be6c22665 100644 --- a/modules/admin-full/luasrc/view/admin_network/wifi_join_settings.htm +++ b/modules/admin-full/luasrc/view/admin_network/wifi_join_settings.htm @@ -28,6 +28,18 @@ $Id$ local dev = luci.http.formvalue("device") local iw = luci.sys.wifi.getiwinfo(dev) + local requirement + + if iwinfo.type(dev) == "broadcom" and not nixio.fs.access("/usr/sbin/nas") then + requirement = luci.i18n.translatef("a_s_iw_require_nas", + "You need to install the <a href='%s'>Broadcom <em>nas</em> supplicant</a> to use WPA!" + % luci.dispatcher.build_url("admin/system/packages?url=nas&submit=1")) + elseif not nixio.fs.access("/usr/sbin/wpa_supplicant") then + requirement = luci.i18n.translatef("a_s_iw_require_wpasupplicant", + "You need to install <a href='%s'><em>wpa-supplicant</em></a> to use WPA!" + % luci.dispatcher.build_url("admin/system/packages?url=wpa-supplicant&submit=1")) + end + -%> <%+header%> @@ -71,6 +83,10 @@ $Id$ <input type="hidden" name="wpa_suite" value="psk<%=tonumber(luci.http.formvalue("wpa_version") or 0) == 2 and 2%>" /> <% end %> + <% if requirement then %> + <strong class="error"> <%=requirement%></strong> + <% end %> + <br /><br /> <% end %> @@ -87,7 +103,7 @@ $Id$ <% if luci.http.formvalue("mode") == "Ad-Hoc" then %> <input type="checkbox" name="fixed_bssid" value="1" id="cb_fixed_bssid" checked="checked" /> - <label for="cb_fixed_bssid">Lock to BSSID <%=luci.http.formvalue("bssid")%></label> + <label for="cb_fixed_bssid">Lock BSSID to <%=luci.http.formvalue("bssid")%></label> <br /> <% end %> diff --git a/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm b/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm index 251f767d23..580fe9abec 100644 --- a/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm +++ b/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm @@ -130,7 +130,7 @@ $Id$ end function find_wifi_frequency(state) - if state.active then + if state and state.active and state.networks[1] and state.networks[1].info then return string.format("%d (%.03f GHz)", state.networks[1].info.channel, state.networks[1].info.frequency / 1000); @@ -161,7 +161,7 @@ $Id$ <td colspan="2" style="text-align:left"> <big><strong><%=state.hwname%> (<%=dev%>)</strong></big><br /> <strong>Channel:</strong> <%=find_wifi_frequency(state)%> | - <strong>Bitrate:</strong> <%=state.active and (state.networks[1].info.bitrate / 1000) .. " Mb/s" or "n/a"%> + <strong>Bitrate:</strong> <%=(state and state.networks[1]) and (state.networks[1].info.bitrate / 1000) .. " Mb/s" or "n/a"%> </td> <td style="width:40px"> <a href="<%=luci.dispatcher.build_url("admin/network/wireless_join?device="..dev)%>"><img style="border:none" src="<%=resource%>/cbi/find.gif" alt="Find and join network" title="Find and join network" /></a> |