<%# LuCI - Lua Configuration Interface Copyright 2009 Jo-Philipp Wich Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 $Id: wifi_join.htm 9327 2012-09-26 17:38:14Z jow $ -%> <%+functionlist%> <%=luci.http.formvalue("title") or translate("Site Survey")%> <%- local http = require "luci.http" local sys = require "luci.sys" local utl = require "luci.util" local uci = luci.model.uci.cursor() function guess_wifi_signal(info) local scale = (100 / (info.quality_max or 100) * (info.quality or 0)) local icon if not info.bssid or info.bssid == "00:00:00:00:00:00" then icon = resource .. "/icons/signal-none.png" elseif scale < 15 then icon = resource .. "/icons/signal-0.png" elseif scale < 35 then icon = resource .. "/icons/signal-0-25.png" elseif scale < 55 then icon = resource .. "/icons/signal-25-50.png" elseif scale < 75 then icon = resource .. "/icons/signal-50-75.png" else icon = resource .. "/icons/signal-75-100.png" end return icon end function percent_wifi_signal(info) local qc = info.quality or 0 local qm = info.quality_max or 0 if info.bssid and qc > 0 and qm > 0 then return math.floor((100 / qm) * qc) else return 0 end end function format_wifi_encryption(info) if info.wep == true then return "WEP" elseif info.wpa > 0 then return translatef("%s - %s", table.concat(info.pair_ciphers, ", "), table.concat(info.group_ciphers, ", "), (info.wpa == 3) and translate("mixed WPA/WPA2") or (info.wpa == 2 and "WPA2" or "WPA"), table.concat(info.auth_suites, ", ") ) elseif info.enabled then return "%s" % translate("unknown") else return "%s" % translate("open") end end local dev = luci.http.formvalue("device") local tmpOpmode = luci.http.formvalue("tmpOpmode") local netid = luci.http.formvalue("netid") local iw = luci.sys.wifi.getiwinfo(dev) local back = luci.http.formvalue("back") if not iw then luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless_device")) return end function scanlist(times) local i, k, v local l = { } local s = { } for i = 1, times do for k, v in ipairs(iw.scanlist or { }) do if not s[v.bssid] then l[#l+1] = v s[v.bssid] = true end end end return l end -%> <% if uci:get('functionlist','functionlist','SUPPORT_AP_RP_SETUP_WIZARD') == "1" and uci:get("system","firmware","first_login") == "1" then %> <%+header%> <% end %>
<% if uci:get('functionlist','functionlist','SUPPORT_AP_RP_SETUP_WIZARD') == "1" then %> <% end %>
<%:Loading%> <%:Scanning%> ...
" /> <% if uci:get('functionlist','functionlist','SUPPORT_AP_RP_SETUP_WIZARD') == "1" and uci:get("system","firmware","first_login") == "1" then %> <% end %>