From 3b23203ce95c48a08b417a303ee8c6dc47f6eb60 Mon Sep 17 00:00:00 2001 From: Steven Hessing Date: Thu, 21 Sep 2017 22:08:43 -0700 Subject: luci-app-noddos: Noddos, device-aware cloud-powered firewall (new package) Signed-off-by: Steven Hessing --- .../luci-app-noddos/luasrc/view/noddos/clients.htm | 111 +++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 applications/luci-app-noddos/luasrc/view/noddos/clients.htm (limited to 'applications/luci-app-noddos/luasrc/view/noddos') diff --git a/applications/luci-app-noddos/luasrc/view/noddos/clients.htm b/applications/luci-app-noddos/luasrc/view/noddos/clients.htm new file mode 100644 index 0000000000..45c9ca8c1e --- /dev/null +++ b/applications/luci-app-noddos/luasrc/view/noddos/clients.htm @@ -0,0 +1,111 @@ +<%# + Copyright (C) 2017 Steven Hessing + This is free software, licensed under the GNU General Public License v3. + /usr/lib/lua/luci/view/clients.htm +-%> + +<%- + + require "nixio.fs" + require "os" + + local last_modified = "" + local style = true + local v + local devdump + + if nixio.fs.access("/var/lib/noddos/DeviceDump.json") then + last_modified = os.date("%c", nixio.fs.stat("/var/lib/noddos/DeviceDump.json")['mtime']) + io.input("/var/lib/noddos/DeviceDump.json") + t = io.read("*all") + devdump = luci.jsonc.parse(t) + io.input("/var/lib/noddos/DeviceProfiles.json") + t = io.read("*all") + temp = luci.jsonc.parse(t) + devicevalues = {} + for i, v in ipairs(temp) do + devicevalues[v.DeviceProfileUuid] = v + end + end +-%> + +<%+header%> + +
+

<%:Clients%>

+
<%:The following clients have been discovered on the network. The last discovery was completed at %><%=last_modified%>
+ +
+ Recognized Clients +
+ + + + + + + + + + + <% + for i,v in ipairs(devdump) do + if v.DeviceProfileUuid ~= "" then + %> + + + + + + + + + <% + style=false + end + end + %> +
HostnameIPv4MACManufacturerModelClass
<%=v.Hostname%><%=v.Ipv4Address%><%=v.MacAddress%><%=devicevalues[v.DeviceProfileUuid].Manufacturer%><%=devicevalues[v.DeviceProfileUuid].Model%><%=devicevalues[v.DeviceProfileUuid].ThingClass%>
+
+
+
+
+ Unrecognized Clients +
+ + + + + + + + + + + + <% + for i,v in ipairs(devdump) do + if v.DeviceProfileUuid == "" then + %> + + + + + + + + + + <% + style=false + end + end + %> +
HostnameIPv4MACManufacturerModelDhcpVendorDhcpHostname
<%=v.Hostname%><%=v.Ipv4Address%><%=v.MacAddress%><%=v.SsdpManufacturer%><%=v.SsdpModelName%><%=v.DhcpVendor1%><%=v.DhcpHostname%>
+
+
+ +
+ +<%+footer%> + -- cgit v1.2.3