X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fadmin-full%2Fluasrc%2Fview%2Fadmin_network%2Fwifi_overview.htm;h=d23a0853a6f328443ba1ae29120ffaaeddd6dce5;hp=93ce748f1a213a8a0b01bb410a3d598a21ffaaef;hb=3386d649ea5c7b98ab654e0ae9c7228615b476b2;hpb=66fe827403545c31236048d666e76d3f2b5738fe 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 93ce748f1..d23a0853a 100644 --- a/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm +++ b/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm @@ -1,7 +1,7 @@ <%# LuCI - Lua Configuration Interface Copyright 2008-2009 Steven Barth -Copyright 2008-2009 Jo-Philipp Wich +Copyright 2008-2010 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. @@ -18,9 +18,9 @@ $Id$ local sys = require "luci.sys" local utl = require "luci.util" local uci = require "luci.model.uci".cursor() - local wlm = require "luci.model.wireless" + local ntm = require "luci.model.network" - wlm.init(uci) + ntm.init(uci) function guess_wifi_hw(ifname) local name, idx = ifname:match("^([a-z]+)(%d+)") @@ -72,54 +72,200 @@ $Id$ end end - function guess_wifi_signal(scale) - local icon - - if scale < 0 then - icon = resource .. "/icons/signal-none.png" - elseif scale < 1 then - icon = resource .. "/icons/signal-0.png" - elseif scale < 2 then - icon = resource .. "/icons/signal-0-25.png" - elseif scale < 3 then - icon = resource .. "/icons/signal-25-50.png" - elseif scale < 4 then - icon = resource .. "/icons/signal-50-75.png" - else - icon = resource .. "/icons/signal-75-100.png" - end + local devices = ntm:get_wifidevs() + local arpcache = { } + sys.net.arptable(function(e) arpcache[e["HW address"]:upper()] = e["IP address"] end) - return icon - end + local netlist = { } + local netdevs = { } - local devices = wlm:get_devices() - local arpcache = { } - sys.net.arptable(function(e) arpcache[e["HW address"]] = e["IP address"] end) + local dev + for _, dev in ipairs(devices) do + local net + for _, net in ipairs(dev:get_wifinets()) do + netlist[#netlist+1] = net:ifname() + netdevs[net:ifname()] = dev:name() + end + end -%> <%+header%> -

<%:a_s_iw_overview Wireless Overview%>

+ + + +

<%:Wireless Overview%>

- <% for _, dev in ipairs(devices) do local nets = dev:get_networks() %> + <% for _, dev in ipairs(devices) do local nets = dev:get_wifinets() %>
- + @@ -129,19 +275,16 @@ $Id$ <% for i, net in ipairs(nets) do %> - - <% end %> @@ -149,7 +292,7 @@ $Id$ <% end %> @@ -160,43 +303,23 @@ $Id$ <% end %> - - -

<%:a_s_iw_overview2 Associated Stations%>

+

<%:Associated Stations%>

-
.png" style="float:left; margin-right:10px" /> <%=guess_wifi_hw(dev:name())%> (<%=dev:name()%>)
- <% if nets[1] then %> - Channel: <%=nets[1]:channel() or "?"%> (<%=nets[1]:frequency() or "?"%> GHz) | - Bitrate: <%=nets[1]:bitrate() or "?"%> Mb/s - <% end %> +
- Find and join network - Provide new network + ?device=<%=dev:name()%>"><%:Find and join network%> + ?device=<%=dev:name()%>"><%:Provide new network%>
-
- <%=net:signal_percent()%>% +
+
+ 0%
- SSID: <%=utl.pcdata(net:active_ssid())%> | - Mode: <%=net:active_mode_i18n()%>
- BSSID: <%=net:active_bssid()%> | - Encryption: <%=net:active_encryption()%> +
+ <%:Collecting data...%> - Edit this network - ">Delete this network + <%:Edit this network%> + "><%:Delete this network%>
- (No network configured on this device) + <%:No network configured on this device%>
+
- - - - - + + + + + - - <% local count = -1 %> - <% for _, dev in ipairs(devices) do local nets = dev:get_networks() %> - <% for _, net in ipairs(nets) do %> - <% for mac, info in utl.kspairs(net:assoclist()) do count = count + 1 %> - - - - - - - - - <% end %> - <% end %> - <% end %> - <% if count <= 0 then %> - <% end %>
SSIDMACAddressSignalNoise<%:SSID%><%:MAC%><%:Address%><%:Signal%><%:Noise%>
<%=net:active_ssid()%><%=mac%><%=arpcache[mac] or "n/a"%><%=info.signal%> dBm<%=info.noise%> dBm
- No information available + <%:Collecting data...%>