X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=applications%2Fluci-splash%2Fluasrc%2Fview%2Fadmin_status%2Fsplash.htm;h=56cbe01c274f3b8b899354881b34a792e5427556;hb=839dcdc01299869bc714990c19d8e244f18318b5;hp=11af7f5eca72b6b82d57aa595aedc04923d21c4a;hpb=7c765875884d6866c53b63757731b079bace2e9b;p=project%2Fluci.git diff --git a/applications/luci-splash/luasrc/view/admin_status/splash.htm b/applications/luci-splash/luasrc/view/admin_status/splash.htm index 11af7f5ec..56cbe01c2 100644 --- a/applications/luci-splash/luasrc/view/admin_status/splash.htm +++ b/applications/luci-splash/luasrc/view/admin_status/splash.htm @@ -123,25 +123,116 @@ 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%> + + + +
-

<%:ff_splash Client-Splash%>

+

<%:Client-Splash%>

- <%:ff_splash_clients Active Clients%> + <%:Active Clients%>
<% if is_admin then %>
<% end %> - - - - - - - - + + + + + + + + + + + <%- local count = 0 @@ -157,7 +248,7 @@ end if c.ip then count = count + 1 -%> - + @@ -169,31 +260,31 @@ end - - <%- + + <%- + end end - end - - if count == 0 then - -%> - - - + if count == 0 then + -%> + + + <%- end -%> +
<%:ff_splash_hostname Hostname%><%:ff_splash_ip IP Address%><%:ff_splash_mac MAC Address%><%:ff_splash_timeleft Time remaining%><%:ff_splash_traffic Traffic in/out%><%:ff_splash_policy 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)%> <% if is_admin then %> - + <% else %> <%=c.policy%> <% end %>
-
<%:ff_splash_noclients No clients connected%>
-
+
<%:No clients connected%>
+
<% if is_admin then %>
<% end %>