+ local arpcache = get_arpcache()
+
+ local blackwhitelist = uci:get_all("luci_splash")
+ local whitelist_total = 0
+ local whitelist_online = 0
+ local blacklist_total = 0
+ local blacklist_online = 0
+
+ -- Whitelist, Blacklist
+ for _, s in utl.spairs(blackwhitelist,
+ function(a,b) return blackwhitelist[a][".type"] > blackwhitelist[b][".type"] end
+ ) do
+ if (s[".type"] == "whitelist") then
+ whitelist_total = whitelist_total + 1
+ if s.mac then
+ local mac = s.mac:lower()
+ if arpcache[mac] then
+ whitelist_online = whitelist_online + 1
+ end
+ end
+ end
+ if (s[".type"] == "blacklist") then
+ blacklist_total = blacklist_total + 1
+ if s.mac then
+ local mac = s.mac:lower()
+ if arpcache[mac] then
+ blacklist_online = blacklist_online + 1
+ end
+ end
+ end
+ end
+
+ uci:section("luci_splash_leases", "stats", "stats", {
+ leases = leasecount,
+ whitelisttotal = whitelist_total,
+ whitelistonline = whitelist_online,
+ blacklisttotal = blacklist_total,
+ blacklistonline = blacklist_online,
+ })
+
+ uci:save("luci_splash_leases")