applications/luci-splash: Use a seperate config file for leases, #590
[project/luci.git] / applications / luci-splash / luasrc / view / admin_status / splash.htm
index 86cb9c8..61b32ba 100644 (file)
@@ -19,7 +19,6 @@ 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
@@ -31,7 +30,7 @@ uci:foreach("dhcp", "dnsmasq",
        end)
 
 
-uci:foreach("luci_splash", "lease",
+uci:foreach("luci_splash_leases", "lease",
        function(s)
                if s.start and s.mac then
                        clients[s.mac:lower()] = {
@@ -193,7 +192,7 @@ end
                                                s += '<option value="normal" selected="selected"><%:splashed%></option>';
                                                s += '<option value="kicked"><%:temporarily blocked%></option>'
                                        } else {
-                                               s += 'option value="normal"><%:splashed%></option>'
+                                               s += '<option value="normal"><%:splashed%></option>'
                                        };
                                        if (splash.policy == 'blacklist') {
                                                s+= '<option value="blacklist" selected="selected"><%:blacklisted%></option>'
@@ -207,7 +206,7 @@ end
                                <% else %>
                                        s += String.format('%s', splash.policy);
                                <% end %>
-                                       s += '</td></tr></tbody>'
+                                       s += '</td></tr>'
                                }
                                tbody.innerHTML = s;
                        }
@@ -233,6 +232,7 @@ end
                                                <th class="cbi-section-table-cell"><%:Policy%></th>
                                        </tr>
                                </thead>
+                               <tbody id="splash_table">
 
                                <%-
                                        local count = 0
@@ -248,7 +248,6 @@ end
                                                if c.ip then
                                                        count = count + 1
                                -%>
-                                       <tbody id="splash_table">
                                                <tr class="cbi-section-table-row cbi-rowstyle-<%=2-(count%2)%>">
                                                <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>