+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
+<script type="text/javascript">//<![CDATA[
+
+ XHR.poll(10 , '<%=REQUEST_URI%>', { status: 1 },
+ function(x, info)
+ {
+ var tbody = document.getElementById('splash_table');
+ if (tbody)
+ {
+ var s = '';
+ if (info.length == undefined) {
+ s += '<tr class="cbi-section-table-row"><td colspan="7" class="cbi-section-table-cell"><br /><em><%:No clients connected%></em><br /></td></tr>'
+ };
+ for (var idx = 0; idx < info.length; idx++)
+ {
+ var splash = info[idx];
+ s += String.format(
+ '<tr class="cbi-section-table-row cbi-rowstyle-'+(1 + (idx % 2))+'">' +
+ '<td class="cbi-section-table-cell">%s</td>' +
+ '<td class="cbi-section-table-cell">%s</td>' +
+ '<td class="cbi-section-table-cell">%s</td>' +
+ '<td class="cbi-section-table-cell">%s</td>' +
+ '<td class="cbi-section-table-cell">%s/%s</td>' +
+ '<td class="cbi-section-table-cell">',
+ splash.hostname, splash.ip, splash.mac, splash.timeleft, splash.trafficin, splash.trafficout);
+
+ <% if is_admin then %>
+ s += String.format('<select name="policy.%s" style="width:200px">', splash.mac.toLowerCase());
+ if (splash.policy == 'whitelist') {
+ s += '<option value="whitelist" selected="selected"><%:whitelisted%></option>'
+ } else {
+ s += '<option value="whitelist"><%:whitelisted%></option>'
+ };
+ if (splash.policy == 'normal') {
+ s += '<option value="normal" selected="selected"><%:splashed%></option>';
+ s += '<option value="kicked"><%:temporarily blocked%></option>'
+ } else {
+ s += 'option value="normal"><%:splashed%></option>'
+ };
+ if (splash.policy == 'blacklist') {
+ s+= '<option value="blacklist" selected="selected"><%:blacklisted%></option>'
+ } else {
+ s += '<option value="blacklist"><%:blacklisted%></option>'
+ };
+ s += String.format(
+ '</select>' +
+ '<input type="submit" class="cbi-button cbi-button-save" name="save.%s" value="<%:Save%>" />',
+ splash.mac.toLowerCase());
+ <% else %>
+ s += String.format('%s', splash.policy);
+ <% end %>
+ s += '</td></tr></tbody>'
+ }
+ tbody.innerHTML = s;
+ }
+ }
+ );
+//]]></script>
+
+