m = Map("Network Overview", translate("Network Overview")) m.pageaction = false s = m:section(NamedSection, "__networkoverview__") function s.render(self, sid) local tpl = require "luci.template" local json = require "luci.json" local utl = require "luci.util" tpl.render_string([[ <% local status = require "luci.tools.ieee80211" local utl = require "luci.util" local sys = require "luci.sys" local hosts = sys.net.host_hints() local stat = utl.ubus("dawn", "get_network", { }) local name, macs for name, macs in pairs(stat) do local mac, data for mac, data in pairs(macs) do %> <% end %> <% end %>
SSID MAC Channel Utilization Frequency Stations HT Sup VHT Sup
<%= name %> <%= mac %> <%= "%.2f" %(data.channel_utilization / 2.55) %> % <%= "%.3f" %( data.freq / 1000 ) %> GHz (Channel: <%= "%d" %( status.frequency_to_channel(data.freq) ) %>) <%= "%d" %data.num_sta %> <%= (data.ht_support == true) and "available" or "not available" %> <%= (data.vht_support == true) and "available" or "not available" %>

Clients <% local mac2, data2 for clientmac, clientvals in pairs(data) do if (type(clientvals) == "table") then %> <% end end %>
MAC HT VHT Signal
<%= clientmac %> <%= (clientvals.ht == true) and "available" or "not available" %> <%= (clientvals.vht == true) and "available" or "not available" %> <%= "%d" %clientvals.signal %>

]]) end return m