From 4af446b51073e672e13e067f1ca7286357aaff68 Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Sun, 19 Apr 2020 22:50:40 +0200 Subject: [PATCH 1/1] luci-app-dawn: network overview rewrite with div tables Signed-off-by: Jonny Tischbein --- .../luasrc/model/cbi/dawn/dawn_network.lua | 146 +++++++++--------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_network.lua b/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_network.lua index fb6ab298a..c626a3d0c 100644 --- a/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_network.lua +++ b/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_network.lua @@ -8,84 +8,84 @@ function s.render(self, sid) 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 + %> + +
+

SSID: <%= name %>

+
+
+
AP
+
Clients
+
<% - 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 + local mac, data + for mac, data in pairs(macs) do %> -
- - - - - - - - - - - - - - - - - - <% - end - %> +
+
+
+
+
MAC
+
Utilization
+
Frequency
+
Stations
+
HT Sup
+
VHT Sup
+
+
+
<%= 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" %>
+
+
+
+
+
+
+
MAC
+
HT
+
VHT
+
Signal
+
+ <% + local mac2, data2 + for clientmac, clientvals in pairs(data) do + if (type(clientvals) == "table") then + %> +
+
<%= clientmac %>
+
<%= (clientvals.ht == true) and "available" or "not available" %>
+
<%= (clientvals.vht == true) and "available" or "not available" %>
+
<%= "%d" %clientvals.signal %>
+
+ <% + end + %> + <% + end + %> +
+
+
<% end %> - -
SSIDMACChannel UtilizationFrequencyStationsHT SupVHT 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 - %> - -
MACHTVHTSignal
<%= clientmac %><%= (clientvals.ht == true) and "available" or "not available" %><%= (clientvals.vht == true) and "available" or "not available" %><%= "%d" %clientvals.signal %>
-

+ + + <% + end + %> ]]) end -- 2.25.1