local ipt = require "luci.sys.iptparser".IptParser()
local uci = require "luci.model.uci".cursor_state()
local wat = require "luci.tools.webadmin"
+local fs = require "nixio.fs"
+luci.i18n.loadc("splash")
+
local clients = { }
local leasetime = tonumber(uci:get("luci_splash", "general", "leasetime") or 1) * 60 * 60
local leasefile = "/tmp/dhcp.leases"
end
end)
-if luci.fs.access(leasefile) then
+if fs.access(leasefile) then
for l in io.lines(leasefile) do
local time, mac, ip, name = l:match("^(%d+) (%S+) (%S+) (%S+)")
if time and mac and ip then
<%+header%>
<div id="cbi-splash-leases" class="cbi-map">
- <h2><a id="content" name="content"><%:ff_splash Client-Splash%></a></h2>
+ <h2><a id="content" name="content"><%:Client-Splash%></a></h2>
<fieldset id="cbi-table-table" class="cbi-section">
- <legend><%:ff_splash_clients Active Clients%></legend>
+ <legend><%:Active Clients%></legend>
<div class="cbi-section-node">
<% if is_admin then %><form action="<%=REQUEST_URI%>" method="post"><% end %>
<table class="cbi-section-table">
<tr class="cbi-section-table-titles">
- <th class="cbi-section-table-cell"><%:ff_splash_hostname Hostname%></th>
- <th class="cbi-section-table-cell"><%:ff_splash_ip IP Address%></th>
- <th class="cbi-section-table-cell"><%:ff_splash_mac MAC Address%></th>
- <th class="cbi-section-table-cell"><%:ff_splash_timeleft Time remaining%></th>
- <th class="cbi-section-table-cell"><%:ff_splash_traffic Traffic in/out%></th>
- <th class="cbi-section-table-cell"><%:ff_splash_policy Policy%></th>
+ <th class="cbi-section-table-cell"><%:Hostname%></th>
+ <th class="cbi-section-table-cell"><%:IP Address%></th>
+ <th class="cbi-section-table-cell"><%:MAC Address%></th>
+ <th class="cbi-section-table-cell"><%:Time remaining%></th>
+ <th class="cbi-section-table-cell"><%:Traffic in/out%></th>
+ <th class="cbi-section-table-cell"><%:Policy%></th>
</tr>
<%-
count = count + 1
-%>
<tr class="cbi-section-table-row cbi-rowstyle-<%=2-(count%2)%>">
- <td class="cbi-section-table-cell"><%=c.hostname or "<em>" .. translate("ff_splash_unknown", "unknown") .. "</em>"%></td>
- <td class="cbi-section-table-cell"><%=c.ip or "<em>" .. translate("ff_splash_unknown", "unknown") .. "</em>"%></td>
+ <td class="cbi-section-table-cell"><%=c.hostname or "<em>" .. translate("unknown") .. "</em>"%></td>
+ <td class="cbi-section-table-cell"><%=c.ip or "<em>" .. translate("unknown") .. "</em>"%></td>
<td class="cbi-section-table-cell"><%=showmac(c.mac)%></td>
<td class="cbi-section-table-cell"><%=
(c.limit >= os.time()) and wat.date_format(c.limit-os.time()) or
- (c.policy ~= "normal") and "-" or "<em>" .. translate("ff_splash_expired", "expired") .. "</em>"
+ (c.policy ~= "normal") and "-" or "<em>" .. translate("expired") .. "</em>"
%></td>
<td class="cbi-section-table-cell"><%=wat.byte_format(c.bytes_in)%> / <%=wat.byte_format(c.bytes_out)%></td>
<td class="cbi-section-table-cell">
<% if is_admin then %>
<select name="policy.<%=c.mac:lower()%>" style="width:200px">
- <option value="whitelist"<%=c.policy=="whitelist" and ' selected="selected"'%>><%:ff_splash_whitelisted whitelisted%></option>
- <option value="normal"<%=c.policy=="normal" and not c.kicked and ' selected="selected"'%>><%:ff_splash_splashed splashed%></option>
- <option value="blacklist"<%=c.policy=="blacklist" and ' selected="selected"'%>><%:ff_splash_blacklisted blacklisted%></option>
+ <option value="whitelist"<%=c.policy=="whitelist" and ' selected="selected"'%>><%:whitelisted%></option>
+ <option value="normal"<%=c.policy=="normal" and not c.kicked and ' selected="selected"'%>><%:splashed%></option>
+ <option value="blacklist"<%=c.policy=="blacklist" and ' selected="selected"'%>><%:blacklisted%></option>
<% if c.policy == "normal" then -%>
- <option value="kicked"><%:ff_splash_tempblock temporarily blocked%></option>
+ <option value="kicked"><%:temporarily blocked%></option>
<%- end %>
</select>
- <input type="submit" class="cbi-button cbi-button-save" name="save.<%=c.mac:lower()%>" value="<%:save Save%>" />
+ <input type="submit" class="cbi-button cbi-button-save" name="save.<%=c.mac:lower()%>" value="<%:Save%>" />
<% else %>
<%=c.policy%>
<% end %>
-%>
<tr class="cbi-section-table-row">
<td colspan="7" class="cbi-section-table-cell">
- <br /><em><%:ff_splash_noclients No clients connected%></em><br />
+ <br /><em><%:No clients connected%></em><br />
</td>
</tr>
<%- end -%>