summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-dawn/luasrc
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-dawn/luasrc')
-rw-r--r--applications/luci-app-dawn/luasrc/controller/dawn.lua10
-rw-r--r--applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua70
-rw-r--r--applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_network.lua94
-rw-r--r--applications/luci-app-dawn/luasrc/tools/ieee80211.lua20
4 files changed, 0 insertions, 194 deletions
diff --git a/applications/luci-app-dawn/luasrc/controller/dawn.lua b/applications/luci-app-dawn/luasrc/controller/dawn.lua
deleted file mode 100644
index 1ae903f3a4..0000000000
--- a/applications/luci-app-dawn/luasrc/controller/dawn.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-module("luci.controller.dawn", package.seeall)
-
-function index()
- local e = entry({ "admin", "dawn" }, firstchild(), "DAWN", 60)
- e.dependent = false
- e.acl_depends = { "luci-app-dawn" }
-
- entry({ "admin", "dawn", "view_network" }, cbi("dawn/dawn_network"), "View Network Overview", 1)
- entry({ "admin", "dawn", "view_hearing_map" }, cbi("dawn/dawn_hearing_map"), "View Hearing Map", 2)
-end
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
deleted file mode 100644
index 3ba5329855..0000000000
--- a/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_hearing_map.lua
+++ /dev/null
@@ -1,70 +0,0 @@
-m = Map("dawn", "Hearing Map", translate("Hearing Map"))
-m.pageaction = false
-
-s = m:section(NamedSection, "__hearingmap__")
-
-function s.render(self, sid)
- local tpl = require "luci.template"
- tpl.render_string([[
- <%
- local utl = require "luci.util"
- local xml = require "luci.xml"
- local status = require "luci.tools.ieee80211"
- local stat = utl.ubus("dawn", "get_hearing_map", { })
- local name, macs
-
- for name, macs in pairs(stat) do
- %>
- <div class="cbi-section-node">
- <h3>SSID: <%= xml.pcdata(name) %></h3>
- <table class="table" id="dawn_hearing_map">
- <tr class="tr table-titles">
- <th class="th">Client MAC</th>
- <th class="th">AP MAC</th>
- <th class="th">Frequency</th>
- <th class="th">HT Sup</th>
- <th class="th">VHT Sup</th>
- <th class="th">Signal</th>
- <th class="th">RCPI</th>
- <th class="th">RSNI</th>
- <th class="th">Channel Utilization</th>
- <th class="th">Station connect to AP</th>
- <th class="th">Score</th>
- </tr>
- <%
- 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 data2.freq ~= 0 then --prevent empty entry crashes
- %>
- <tr class="tr">
- <td class="td"><%= (count_loop == 0) and mac or "" %></td>
- <td class="td"><%= mac2 %></td>
- <td class="td"><%= "%.3f" %( data2.freq / 1000 ) %> GHz Channel: <%= "%d" %( status.frequency_to_channel(data2.freq) ) %></td>
- <td class="td"><%= (data2.ht_capabilities == true and data2.ht_support == true) and "True" or "False" %></td>
- <td class="td"><%= (data2.vht_capabilities == true and data2.vht_support == true) and "True" or "False" %></td>
- <td class="td"><%= "%d" % data2.signal %></td>
- <td class="td"><%= "%d" % data2.rcpi %></td>
- <td class="td"><%= "%d" % data2.rsni %></td>
- <td class="td"><%= "%.2f" % (data2.channel_utilization / 2.55) %> %</td>
- <td class="td"><%= "%d" % data2.num_sta %></td>
- <td class="td"><%= "%d" % data2.score %></td>
- </tr>
- <%
- count_loop = count_loop + 1
- end
- end
- end
- %>
- </table>
- </div>
- <%
- end
- %>
- ]])
-end
-
-return m
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
deleted file mode 100644
index f9e04b90cb..0000000000
--- a/applications/luci-app-dawn/luasrc/model/cbi/dawn/dawn_network.lua
+++ /dev/null
@@ -1,94 +0,0 @@
-m = Map("dawn", "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 xml = require "luci.xml"
- local hosts = sys.net.host_hints()
- local stat = utl.ubus("dawn", "get_network", { })
- local name, macs
- for name, macs in pairs(stat) do
- %>
- <div class="cbi-section-node">
- <h3>SSID: <%= xml.pcdata(name) %></h3>
- <table class="table" id="network_overview_main">
- <tr class="tr table-titles">
- <th class="th">AP</th>
- <th class="th">Clients</th>
- </tr>
- <%
- local mac, data
- for mac, data in pairs(macs) do
- %>
- <tr class="tr">
- <td class="td" style="vertical-align: top;">
- <table class="table" id="ap-<%= mac %>">
- <tr class="tr table-titles">
- <th class="th">Hostname</th>
- <th class="th">Interface</th>
- <th class="th">MAC</th>
- <th class="th">Utilization</th>
- <th class="th">Frequency</th>
- <th class="th">Stations</th>
- <th class="th">HT Sup</th>
- <th class="th">VHT Sup</th>
- </tr>
- <tr class="tr">
- <td class="td"><%= xml.pcdata(data.hostname) %></td>
- <td class="td"><%= xml.pcdata(data.iface) %></td>
- <td class="td"><%= mac %></td>
- <td class="td"><%= "%.2f" %(data.channel_utilization / 2.55) %> %</td>
- <td class="td"><%= "%.3f" %( data.freq / 1000 ) %> GHz (Channel: <%= "%d" %( status.frequency_to_channel(data.freq) ) %>)</td>
- <td class="td"><%= "%d" % data.num_sta %></td>
- <td class="td"><%= (data.ht_support == true) and "available" or "not available" %></td>
- <td class="td"><%= (data.vht_support == true) and "available" or "not available" %></td>
- </tr>
- </table>
- </td>
- <td class="td" style="vertical-align: top;">
- <table class="table" id="clients-<%= mac %>">
- <tr class="tr table-titles">
- <th class="th">MAC</th>
- <th class="th">HT</th>
- <th class="th">VHT</th>
- <th class="th">Signal</th>
- </tr>
- <%
- local mac2, data2
- for clientmac, clientvals in pairs(data) do
- if (type(clientvals) == "table") then
- %>
- <tr class="tr">
- <td class="td"><%= clientmac %></td>
- <td class="td"><%= (clientvals.ht == true) and "available" or "not available" %></td>
- <td class="td"><%= (clientvals.vht == true) and "available" or "not available" %></td>
- <td class="td"><%= "%d" % clientvals.signal %></td>
- </tr>
- <%
- end
- end
- %>
- </table>
- </td>
- </tr>
- <%
- end
- %>
- </table>
- </div>
- <%
- end
- %>
- ]])
-end
-
-return m
diff --git a/applications/luci-app-dawn/luasrc/tools/ieee80211.lua b/applications/luci-app-dawn/luasrc/tools/ieee80211.lua
deleted file mode 100644
index 44b0464427..0000000000
--- a/applications/luci-app-dawn/luasrc/tools/ieee80211.lua
+++ /dev/null
@@ -1,20 +0,0 @@
-module("luci.tools.ieee80211", package.seeall)
-
-function frequency_to_channel(freq)
- if (freq <= 2400) then
- return 0;
- elseif (freq == 2484) then
- return 14;
- elseif (freq < 2484) then
- return (freq - 2407) / 5;
- elseif (freq >= 4910 and freq <= 4980) then
- return (freq - 4000) / 5;
- elseif (freq <= 45000) then
- return (freq - 5000) / 5;
- elseif (freq >= 58320 and freq <= 64800) then
- return (freq - 56160) / 2160;
- else
- return 0;
- end
-end
-