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%> + + + +

<%:Client-Splash%>

@@ -134,14 +222,17 @@ end
<% if is_admin then %>
<% end %> - - - - - - - - + + + + + + + + + + + <%- local count = 0 @@ -157,7 +248,7 @@ end if c.ip then count = count + 1 -%> - + @@ -181,19 +272,19 @@ end <%=c.policy%> <% end %> - - <%- + + <%- + end end - end - - if count == 0 then - -%> - - - + if count == 0 then + -%> + + + <%- end -%> +
<%:Hostname%><%:IP Address%><%:MAC Address%><%:Time remaining%><%:Traffic in/out%><%:Policy%>
<%:Hostname%><%:IP Address%><%:MAC Address%><%:Time remaining%><%:Traffic in/out%><%:Policy%>
<%=c.hostname or "" .. translate("unknown") .. ""%> <%=c.ip or "" .. translate("unknown") .. ""%> <%=showmac(c.mac)%>
-
<%:No clients connected%>
-
+
<%:No clients connected%>
+
<% if is_admin then %>
<% end %>