1 m = Map("dawn", "Network Overview", translate("Network Overview"))
4 s = m:section(NamedSection, "__networkoverview__")
6 function s.render(self, sid)
7 local tpl = require "luci.template"
8 local json = require "luci.json"
9 local utl = require "luci.util"
11 <table class="table" style="border: 1px solid grey;">
12 <thead style="background-color: grey; color: white;">
16 <th>Channel Utilization</th>
25 local status = require "luci.tools.ieee80211"
26 local utl = require "luci.util"
27 local sys = require "luci.sys"
28 local hosts = sys.net.host_hints()
29 local stat = utl.ubus("dawn", "get_network", { })
31 for name, macs in pairs(stat) do
33 for mac, data in pairs(macs) do
38 <td><%= "%.2f" %(data.channel_utilization / 2.55) %> %</td>
39 <td><%= "%.3f" %( data.freq / 1000 ) %> GHz (Channel: <%= "%d" %( status.frequency_to_channel(data.freq) ) %>)</td>
40 <td><%= "%d" %data.num_sta %></td>
41 <td><%= (data.ht_support == true) and "available" or "not available" %></td>
42 <td><%= (data.vht_support == true) and "available" or "not available" %></td>
45 <td colspan="7"><hr></td>
48 <td colspan="2" class="center"><strong>Clients</strong></td>
50 <table class="table" style="border: 1px solid grey;">
51 <thead style="background-color: grey; color: white;">
62 for clientmac, clientvals in pairs(data) do
63 if (type(clientvals) == "table") then
66 <td><%= clientmac %></td>
67 <td><%= (clientvals.ht == true) and "available" or "not available" %></td>
68 <td><%= (clientvals.vht == true) and "available" or "not available" %></td>
69 <td><%= "%d" %clientvals.signal %></td>
79 <td colspan="7"><hr></td>