X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-splash%2Fluasrc%2Fview%2Fadmin_status%2Fsplash.htm;h=56cbe01c274f3b8b899354881b34a792e5427556;hp=70e6c06cfe95b2c7893f13811a5b7edb4f616e87;hb=848e43a5b47c0467b90e7d9a029e59ec53461da3;hpb=cffba70b2ebff664e385f077d30cf701cab49a70 diff --git a/applications/luci-splash/luasrc/view/admin_status/splash.htm b/applications/luci-splash/luasrc/view/admin_status/splash.htm index 70e6c06cf..56cbe01c2 100644 --- a/applications/luci-splash/luasrc/view/admin_status/splash.htm +++ b/applications/luci-splash/luasrc/view/admin_status/splash.htm @@ -123,10 +123,98 @@ local function showmac(mac) return mac end +if luci.http.formvalue("status") == "1" then + local rv = {} + for _, c in utl.spairs(clients, + function(a,b) if clients[a].policy == clients[b].policy then + return (clients[a].start > clients[b].start) + else + return (clients[a].policy > clients[b].policy) + end + end) + do + if c.ip then + rv[#rv+1] = { + hostname = c.hostname or "?", + ip = c.ip or "?", + mac = showmac(c.mac) or "?", + timeleft = (c.limit >= os.time()) and wat.date_format(c.limit-os.time()) or (c.policy ~= "normal") and "-" or "expired", + trafficin = wat.byte_format(c.bytes_in) or "?", + trafficout = wat.byte_format(c.bytes_out) or "?", + policy = c.policy or "?" + } + end + end + luci.http.prepare_content("application/json") + luci.http.write_json(rv) + return +end -%> + + <%+header%> + + + +