From 59d426f20bbc150ab9b9110b5ed30c59e243eed5 Mon Sep 17 00:00:00 2001 From: Jonny Tischbein Date: Sat, 18 Apr 2020 12:42:20 +0200 Subject: luci-app-dawn: hearing map with div tables Signed-off-by: Jonny Tischbein --- .../luasrc/model/cbi/dawn/dawn_hearing_map.lua | 109 +++++++++------------ 1 file changed, 48 insertions(+), 61 deletions(-) (limited to 'applications/luci-app-dawn/luasrc/model') diff --git a/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua b/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua index e8b0240ea5..29bcb2f112 100644 --- a/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua +++ b/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua @@ -6,7 +6,6 @@ s = m:section(NamedSection, "__hearingmap__") function s.render(self, sid) local tpl = require "luci.template" tpl.render_string([[ - <% local utl = require "luci.util" local status = require "luci.tools.ieee80211" @@ -14,71 +13,59 @@ function s.render(self, sid) local name, macs for name, macs in pairs(stat) do - local count = 0 - for a,b in pairs(macs) do for _ in pairs(b) do count = count + 1 end end %> - - - - - - - - - - - - - - - - - - - - - <% - local mac, data - for mac, data in pairs(macs) do - local mac2, data2 - local count_macs = 0 - local count_loop = 0 - for _ in pairs(data) do count_macs = count_macs + 1 end +
+

SSID: <%= name %>

+
+
+
Client MAC
+
AP MAC
+
Frequency
+
HT Sup
+
VHT Sup
+
Signal
+
RCPI
+
RSNI
+
Channel Utilization
+
Station connect to AP
+
Score
+
+ <% + local mac, data + for mac, data in pairs(macs) do + local mac2, data2 + local count_loop = 0 - for mac2, data2 in pairs(data) do - %> -
- <% if (count_macs > 1) then %> - <% if (count_loop == 0 ) then %> - - <% end %> - <% else %> - - <% end %> - - - - - - - - - - - - <% - count_loop = count_loop + 1 - end - %> - <% - end - %> - - -
SSIDClient MACAP MACFrequencyHT SupVHT SupSignalRCPIRSNIChannel
Utilization
Station connect
to AP
Score
<%= name %>
<%= mac %><%= mac %><%= mac2 %><%= "%.3f" %( data2.freq / 1000 ) %> GHz
(Channel: <%= "%d" %( status.frequency_to_channel(data2.freq) ) %>)
<%= (data2.ht_capabilities == true and data2.ht_support == true) and "True" or "False" %><%= (data2.vht_capabilities == true and data2.vht_support == true) and "True" or "False" %><%= "%d" %data2.signal %><%= "%d" %data2.rcpi %><%= "%d" %data2.rsni %><%= "%.2f" %(data2.channel_utilization / 2.55) %> %<%= "%d" %data2.num_sta %><%= "%d" %data2.score %>
+ for mac2, data2 in pairs(data) do + %> +
+ <% if (count_loop == 0) then %> +
<%= mac %>
+ <% else %> +
+ <% end %> +
<%= mac2 %>
+
<%= "%.3f" %( data2.freq / 1000 ) %> GHz Channel: <%= "%d" %( status.frequency_to_channel(data2.freq) ) %>
+
<%= (data2.ht_capabilities == true and data2.ht_support == true) and "True" or "False" %>
+
<%= (data2.vht_capabilities == true and data2.vht_support == true) and "True" or "False" %>
+
<%= "%d" %data2.signal %>
+
<%= "%d" %data2.rcpi %>
+
<%= "%d" %data2.rsni %>
+
<%= "%.2f" %(data2.channel_utilization / 2.55) %> %
+
<%= "%d" %data2.num_sta %>
+
<%= "%d" %data2.score %>
+
+ <% + count_loop = count_loop + 1 + end + end + %> + + <% end %> + ]]) end -- cgit v1.2.3