2 Copyright 2008 Steven Barth <steven@midlink.org>
3 Copyright 2008-2011 Jo-Philipp Wich <jow@openwrt.org>
4 Licensed to the public under the Apache License 2.0.
8 local fs = require "nixio.fs"
9 local util = require "luci.util"
10 local stat = require "luci.tools.status"
11 local ver = require "luci.version"
13 local has_ipv6 = fs.access("/proc/net/ipv6_route")
14 local has_dhcp = fs.access("/etc/config/dhcp")
15 local has_wifi = ((fs.stat("/etc/config/wireless", "size") or 0) > 0)
17 local sysinfo = luci.util.ubus("system", "info") or { }
18 local boardinfo = luci.util.ubus("system", "board") or { }
19 local unameinfo = nixio.uname() or { }
21 local meminfo = sysinfo.memory or {
28 local swapinfo = sysinfo.swap or {
33 local has_dsl = fs.access("/etc/init.d/dsl_control")
35 if luci.http.formvalue("status") == "1" then
36 local ntm = require "luci.model.network".init()
37 local wan = ntm:get_wannet()
38 local wan6 = ntm:get_wan6net()
40 local conn_count = tonumber(
41 fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count")) or 0
43 local conn_max = tonumber((
44 luci.sys.exec("sysctl net.nf_conntrack_max") or
45 luci.sys.exec("sysctl net.ipv4.netfilter.ip_conntrack_max") or
46 ""):match("%d+")) or 4096
49 uptime = sysinfo.uptime or 0,
50 localtime = os.date(),
51 loadavg = sysinfo.load or { 0, 0, 0 },
55 conncount = conn_count,
56 leases = stat.dhcp_leases(),
57 leases6 = stat.dhcp6_leases(),
58 wifinets = stat.wifi_networks()
63 ipaddr = wan:ipaddr(),
64 gwaddr = wan:gwaddr(),
65 netmask = wan:netmask(),
67 expires = wan:expires(),
68 uptime = wan:uptime(),
70 ifname = wan:ifname(),
71 link = wan:adminlink()
77 ip6addr = wan6:ip6addr(),
78 gw6addr = wan6:gw6addr(),
79 dns = wan6:dns6addrs(),
80 ip6prefix = wan6:ip6prefix(),
81 uptime = wan6:uptime(),
83 ifname = wan6:ifname(),
84 link = wan6:adminlink()
89 local dsl_stat = luci.sys.exec("/etc/init.d/dsl_control lucistat")
90 local dsl_func = loadstring(dsl_stat)
96 luci.http.prepare_content("application/json")
97 luci.http.write_json(rv)
100 elseif luci.http.formvalue("hosts") == "1" then
101 luci.http.prepare_content("application/json")
102 luci.http.write_json(luci.sys.net.host_hints())
110 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
111 <script type="text/javascript">//<![CDATA[
112 function progressbar(v, m)
114 var vn = parseInt(v) || 0;
115 var mn = parseInt(m) || 100;
116 var pc = Math.floor((100 / mn) * vn);
118 return String.format(
119 '<div style="width:200px; position:relative; border:1px solid #999999">' +
120 '<div style="background-color:#CCCCCC; width:%d%%; height:15px">' +
121 '<div style="position:absolute; left:0; top:0; text-align:center; width:100%%; color:#000000">' +
122 '<small>%s / %s (%d%%)</small>' +
125 '</div>', pc, v, m, pc
129 function wifirate(bss, rx) {
130 var p = rx ? 'rx_' : 'tx_',
131 s = '%.1f <%:Mbit/s%>, %d<%:MHz%>'
132 .format(bss[p+'rate'] / 1000, bss[p+'mhz']),
133 ht = bss[p+'ht'], vht = bss[p+'vht'],
134 mhz = bss[p+'mhz'], nss = bss[p+'nss'],
135 mcs = bss[p+'mcs'], sgi = bss[p+'short_gi'];
138 if (vht) s += ', VHT-MCS %d'.format(mcs);
139 if (nss) s += ', VHT-NSS %d'.format(nss);
140 if (ht) s += ', MCS %s'.format(mcs);
141 if (sgi) s += ', <%:Short GI%>';
147 function duid2mac(duid) {
148 // DUID-LLT / Ethernet
149 if (duid.length === 28 && duid.substr(0, 8) === '00010001')
150 return duid.substr(16).replace(/(..)(?=..)/g, '$1:').toUpperCase();
152 // DUID-LL / Ethernet
153 if (duid.length === 24 && duid.substr(0, 8) === '00030001')
154 return duid.substr(8).replace(/(..)(?=..)/g, '$1:').toUpperCase();
160 var hosts = <%=luci.http.write_json(luci.sys.net.host_hints())%>;
162 function updateHosts() {
163 XHR.get('<%=REQUEST_URI%>', { hosts: 1 }, function(x, data) {
168 XHR.poll(5, '<%=REQUEST_URI%>', { status: 1 },
174 var si = document.getElementById('wan4_i');
175 var ss = document.getElementById('wan4_s');
178 if (ifc && ifc.ifname && ifc.proto != 'none')
180 var s = String.format(
181 '<strong><%:Type%>: </strong>%s<br />' +
182 '<strong><%:Address%>: </strong>%s<br />' +
183 '<strong><%:Netmask%>: </strong>%s<br />' +
184 '<strong><%:Gateway%>: </strong>%s<br />',
186 (ifc.ipaddr) ? ifc.ipaddr : '0.0.0.0',
187 (ifc.netmask && ifc.netmask != ifc.ipaddr) ? ifc.netmask : '255.255.255.255',
188 (ifc.gwaddr) ? ifc.gwaddr : '0.0.0.0'
191 for (var i = 0; i < ifc.dns.length; i++)
194 '<strong><%:DNS%> %d: </strong>%s<br />',
199 if (ifc.expires > -1)
202 '<strong><%:Expires%>: </strong>%t<br />',
210 '<strong><%:Connected%>: </strong>%t<br />',
215 ss.innerHTML = String.format('<small>%s</small>', s);
216 si.innerHTML = String.format(
217 '<img src="<%=resource%>/icons/ethernet.png" />' +
218 '<br /><small><a href="%s">%s</a></small>',
224 si.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>';
225 ss.innerHTML = '<em><%:Not connected%></em>';
228 <% if has_ipv6 then %>
229 var si6 = document.getElementById('wan6_i');
230 var ss6 = document.getElementById('wan6_s');
231 var ifc6 = info.wan6;
233 if (ifc6 && ifc6.ifname && ifc6.proto != 'none')
235 var s = String.format(
236 '<strong><%:Type%>: </strong>%s%s<br />',
237 ifc6.proto, (ifc6.ip6prefix) ? '-pd' : ''
243 '<strong><%:Address%>: </strong>%s<br />',
244 (ifc6.ip6addr) ? ifc6.ip6addr : '::'
250 '<strong><%:Prefix Delegated%>: </strong>%s<br />',
256 '<strong><%:Address%>: </strong>%s<br />',
263 '<strong><%:Gateway%>: </strong>%s<br />',
264 (ifc6.gw6addr) ? ifc6.gw6addr : '::'
267 for (var i = 0; i < ifc6.dns.length; i++)
270 '<strong><%:DNS%> %d: </strong>%s<br />',
278 '<strong><%:Connected%>: </strong>%t<br />',
283 ss6.innerHTML = String.format('<small>%s</small>', s);
284 si6.innerHTML = String.format(
285 '<img src="<%=resource%>/icons/ethernet.png" />' +
286 '<br /><small><a href="%s">%s</a></small>',
287 ifc6.link, ifc6.ifname
292 si6.innerHTML = '<img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small>';
293 ss6.innerHTML = '<em><%:Not connected%></em>';
297 <% if has_dsl then %>
298 var dsl_i = document.getElementById('dsl_i');
299 var dsl_s = document.getElementById('dsl_s');
301 var s = String.format(
302 '<strong><%:Status%>: </strong>%s<br />' +
303 '<strong><%:Line State%>: </strong>%s [0x%x]<br />' +
304 '<strong><%:Line Mode%>: </strong>%s<br />' +
305 '<strong><%:Annex%>: </strong>%s<br />' +
306 '<strong><%:Profile%>: </strong>%s<br />' +
307 '<strong><%:Data Rate%>: </strong>%s/s / %s/s<br />' +
308 '<strong><%:Max. Attainable Data Rate (ATTNDR)%>: </strong>%s/s / %s/s<br />' +
309 '<strong><%:Latency%>: </strong>%s / %s<br />' +
310 '<strong><%:Line Attenuation (LATN)%>: </strong>%s dB / %s dB<br />' +
311 '<strong><%:Signal Attenuation (SATN)%>: </strong>%s dB / %s dB<br />' +
312 '<strong><%:Noise Margin (SNR)%>: </strong>%s dB / %s dB<br />' +
313 '<strong><%:Aggregate Transmit Power(ACTATP)%>: </strong>%s dB / %s dB<br />' +
314 '<strong><%:Forward Error Correction Seconds (FECS)%>: </strong>%s / %s<br />' +
315 '<strong><%:Errored seconds (ES)%>: </strong>%s / %s<br />' +
316 '<strong><%:Severely Errored Seconds (SES)%>: </strong>%s / %s<br />' +
317 '<strong><%:Loss of Signal Seconds (LOSS)%>: </strong>%s / %s<br />' +
318 '<strong><%:Unavailable Seconds (UAS)%>: </strong>%s / %s<br />' +
319 '<strong><%:Header Error Code Errors (HEC)%>: </strong>%s / %s<br />' +
320 '<strong><%:Non Pre-emtive CRC errors (CRC_P)%>: </strong>%s / %s<br />' +
321 '<strong><%:Pre-emtive CRC errors (CRCP_P)%>: </strong>%s / %s<br />' +
322 '<strong><%:Line Uptime%>: </strong>%s<br />' +
323 '<strong><%:ATU-C System Vendor ID%>: </strong>%s<br />' +
324 '<strong><%:Power Management Mode%>: </strong>%s<br />',
325 info.dsl.line_state, info.dsl.line_state_detail,
326 info.dsl.line_state_num,
327 info.dsl.line_mode_s,
330 info.dsl.data_rate_down_s, info.dsl.data_rate_up_s,
331 info.dsl.max_data_rate_down_s, info.dsl.max_data_rate_up_s,
332 info.dsl.latency_num_down, info.dsl.latency_num_up,
333 info.dsl.line_attenuation_down, info.dsl.line_attenuation_up,
334 info.dsl.signal_attenuation_down, info.dsl.signal_attenuation_up,
335 info.dsl.noise_margin_down, info.dsl.noise_margin_up,
336 info.dsl.actatp_down, info.dsl.actatp_up,
337 info.dsl.errors_fec_near, info.dsl.errors_fec_far,
338 info.dsl.errors_es_near, info.dsl.errors_es_far,
339 info.dsl.errors_ses_near, info.dsl.errors_ses_far,
340 info.dsl.errors_loss_near, info.dsl.errors_loss_far,
341 info.dsl.errors_uas_near, info.dsl.errors_uas_far,
342 info.dsl.errors_hec_near, info.dsl.errors_hec_far,
343 info.dsl.errors_crc_p_near, info.dsl.errors_crc_p_far,
344 info.dsl.errors_crcp_p_near, info.dsl.errors_crcp_p_far,
345 info.dsl.line_uptime_s,
346 info.dsl.atuc_vendor_id,
347 info.dsl.power_mode_s
350 dsl_s.innerHTML = String.format('<small>%s</small>', s);
351 dsl_i.innerHTML = String.format(
352 '<img src="<%=resource%>/icons/ethernet.png" />' +
353 '<br /><small>DSL</small>'
357 <% if has_dhcp then %>
358 var ls = document.getElementById('lease_status_table');
362 while( ls.rows.length > 1 )
363 ls.rows[0].parentNode.deleteRow(1);
365 for( var i = 0; i < info.leases.length; i++ )
369 if (info.leases[i].expires === false)
370 timestr = '<em><%:unlimited%></em>';
371 else if (info.leases[i].expires <= 0)
372 timestr = '<em><%:expired%></em>';
374 timestr = String.format('%t', info.leases[i].expires);
376 var tr = ls.rows[0].parentNode.insertRow(-1);
377 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
379 tr.insertCell(-1).innerHTML = info.leases[i].hostname ? info.leases[i].hostname : '?';
380 tr.insertCell(-1).innerHTML = info.leases[i].ipaddr;
381 tr.insertCell(-1).innerHTML = info.leases[i].macaddr;
382 tr.insertCell(-1).innerHTML = timestr;
385 if( ls.rows.length == 1 )
387 var tr = ls.rows[0].parentNode.insertRow(-1);
388 tr.className = 'cbi-section-table-row';
390 var td = tr.insertCell(-1);
392 td.innerHTML = '<em><br /><%:There are no active leases.%></em>';
396 var ls6 = document.getElementById('lease6_status_table');
397 if (ls6 && info.leases6)
399 ls6.parentNode.style.display = 'block';
402 while( ls6.rows.length > 1 )
403 ls6.rows[0].parentNode.deleteRow(1);
405 for( var i = 0; i < info.leases6.length; i++ )
409 if (info.leases6[i].expires === false)
410 timestr = '<em><%:unlimited%></em>';
411 else if (info.leases6[i].expires <= 0)
412 timestr = '<em><%:expired%></em>';
414 timestr = String.format('%t', info.leases6[i].expires);
416 var tr = ls6.rows[0].parentNode.insertRow(-1);
417 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
419 var host = hosts[duid2mac(info.leases6[i].duid)];
420 if (!info.leases6[i].hostname)
421 tr.insertCell(-1).innerHTML =
422 (host && (host.name || host.ipv4 || host.ipv6))
423 ? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">? (%h)</div>'.format(host.name || host.ipv4 || host.ipv6)
426 tr.insertCell(-1).innerHTML =
427 (host && host.name && info.leases6[i].hostname != host.name)
428 ? '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space: nowrap">%h (%h)</div>'.format(info.leases6[i].hostname, host.name)
429 : info.leases6[i].hostname;
431 tr.insertCell(-1).innerHTML = info.leases6[i].ip6addr;
432 tr.insertCell(-1).innerHTML = info.leases6[i].duid;
433 tr.insertCell(-1).innerHTML = timestr;
436 if( ls6.rows.length == 1 )
438 var tr = ls6.rows[0].parentNode.insertRow(-1);
439 tr.className = 'cbi-section-table-row';
441 var td = tr.insertCell(-1);
443 td.innerHTML = '<em><br /><%:There are no active leases.%></em>';
448 <% if has_wifi then %>
451 var ws = document.getElementById('wifi_status_table');
454 var wsbody = ws.rows[0].parentNode;
455 while (ws.rows.length > 0)
458 for (var didx = 0; didx < info.wifinets.length; didx++)
460 var dev = info.wifinets[didx];
462 var tr = wsbody.insertRow(-1);
465 td = tr.insertCell(-1);
467 td.innerHTML = dev.name;
468 td.style.verticalAlign = "top";
470 td = tr.insertCell(-1);
474 for (var nidx = 0; nidx < dev.networks.length; nidx++)
476 var net = dev.networks[nidx];
477 var is_assoc = (net.bssid != '00:00:00:00:00:00' && net.channel && !net.disabled);
481 icon = "<%=resource%>/icons/signal-none.png";
482 else if (net.quality == 0)
483 icon = "<%=resource%>/icons/signal-0.png";
484 else if (net.quality < 25)
485 icon = "<%=resource%>/icons/signal-0-25.png";
486 else if (net.quality < 50)
487 icon = "<%=resource%>/icons/signal-25-50.png";
488 else if (net.quality < 75)
489 icon = "<%=resource%>/icons/signal-50-75.png";
491 icon = "<%=resource%>/icons/signal-75-100.png";
494 '<table><tr><td style="text-align:center; width:32px; padding:3px">' +
495 '<img src="%s" title="<%:Signal%>: %d dBm / <%:Noise%>: %d dBm" />' +
496 '<br /><small>%d%%</small>' +
497 '</td><td style="text-align:left; padding:3px"><small>' +
498 '<strong><%:SSID%>:</strong> <a href="%s">%h</a><br />' +
499 '<strong><%:Mode%>:</strong> %s<br />' +
500 '<strong><%:Channel%>:</strong> %d (%.3f <%:GHz%>)<br />' +
501 '<strong><%:Bitrate%>:</strong> %s <%:Mbit/s%><br />',
502 icon, net.signal, net.noise,
504 net.link, net.ssid || '?',
506 net.channel, net.frequency,
513 '<strong><%:BSSID%>:</strong> %s<br />' +
514 '<strong><%:Encryption%>:</strong> %s',
521 s += '<em><%:Wireless is disabled or not associated%></em>';
524 s += '</small></td></tr></table>';
526 for (var bssid in net.assoclist)
528 var bss = net.assoclist[bssid];
533 bss.ifname = net.ifname;
534 bss.radio = dev.name;
541 s = '<em><%:No information available%></em>';
547 var ac = document.getElementById('wifi_assoc_table');
551 while( ac.rows.length > 1 )
552 ac.rows[0].parentNode.deleteRow(1);
554 assoclist.sort(function(a, b) {
555 return (a.name == b.name)
556 ? (a.bssid < b.bssid)
561 for( var i = 0; i < assoclist.length; i++ )
563 var tr = ac.rows[0].parentNode.insertRow(-1);
564 tr.className = 'cbi-section-table-row cbi-rowstyle-' + (1 + (i % 2));
567 var q = (-1 * (assoclist[i].noise - assoclist[i].signal)) / 5;
569 icon = "<%=resource%>/icons/signal-0.png";
571 icon = "<%=resource%>/icons/signal-0-25.png";
573 icon = "<%=resource%>/icons/signal-25-50.png";
575 icon = "<%=resource%>/icons/signal-50-75.png";
577 icon = "<%=resource%>/icons/signal-75-100.png";
579 tr.insertCell(-1).innerHTML = String.format(
580 '<span class="ifacebadge" title="%q"><img src="<%=resource%>/icons/wifi.png" /> %h</span>',
581 assoclist[i].radio, assoclist[i].ifname
584 tr.insertCell(-1).innerHTML = String.format(
585 '<a href="%s">%s</a>',
587 '%h'.format(assoclist[i].name).nobr()
590 tr.insertCell(-1).innerHTML = assoclist[i].bssid;
592 var host = hosts[assoclist[i].bssid];
594 tr.insertCell(-1).innerHTML = String.format(
595 '<div style="max-width:200px;overflow:hidden;text-overflow:ellipsis">%s</div>',
596 ((host.name && (host.ipv4 || host.ipv6))
597 ? '%h (%s)'.format(host.name, host.ipv4 || host.ipv6)
598 : '%h'.format(host.name || host.ipv4 || host.ipv6)).nobr()
601 tr.insertCell(-1).innerHTML = '?';
603 tr.insertCell(-1).innerHTML = String.format(
604 '<span class="ifacebadge" title="<%:Signal%>: %d <%:dBm%> / <%:Noise%>: %d <%:dBm%> / <%:SNR%>: %d"><img src="%s" /> %d / %d <%:dBm%></span>',
605 assoclist[i].signal, assoclist[i].noise, assoclist[i].signal - assoclist[i].noise,
607 assoclist[i].signal, assoclist[i].noise
610 tr.insertCell(-1).innerHTML = wifirate(assoclist[i], true).nobr() + '<br />' + wifirate(assoclist[i], false).nobr();
613 if (ac.rows.length == 1)
615 var tr = ac.rows[0].parentNode.insertRow(-1);
616 tr.className = 'cbi-section-table-row';
618 var td = tr.insertCell(-1);
620 td.innerHTML = '<br /><em><%:No information available%></em>';
627 if (e = document.getElementById('localtime'))
628 e.innerHTML = info.localtime;
630 if (e = document.getElementById('uptime'))
631 e.innerHTML = String.format('%t', info.uptime);
633 if (e = document.getElementById('loadavg'))
634 e.innerHTML = String.format(
635 '%.02f, %.02f, %.02f',
636 info.loadavg[0] / 65535.0,
637 info.loadavg[1] / 65535.0,
638 info.loadavg[2] / 65535.0
641 if (e = document.getElementById('memtotal'))
642 e.innerHTML = progressbar(
643 ((info.memory.free + info.memory.buffered) / 1024) + " <%:kB%>",
644 (info.memory.total / 1024) + " <%:kB%>"
647 if (e = document.getElementById('memfree'))
648 e.innerHTML = progressbar(
649 (info.memory.free / 1024) + " <%:kB%>",
650 (info.memory.total / 1024) + " <%:kB%>"
653 if (e = document.getElementById('membuff'))
654 e.innerHTML = progressbar(
655 (info.memory.buffered / 1024) + " <%:kB%>",
656 (info.memory.total / 1024) + " <%:kB%>"
659 if (e = document.getElementById('swaptotal'))
660 e.innerHTML = progressbar(
661 (info.swap.free / 1024) + " <%:kB%>",
662 (info.swap.total / 1024) + " <%:kB%>"
665 if (e = document.getElementById('swapfree'))
666 e.innerHTML = progressbar(
667 (info.swap.free / 1024) + " <%:kB%>",
668 (info.swap.total / 1024) + " <%:kB%>"
671 if (e = document.getElementById('conns'))
672 e.innerHTML = progressbar(info.conncount, info.connmax);
678 <h2 name="content"><%:Status%></h2>
680 <fieldset class="cbi-section">
681 <legend><%:System%></legend>
683 <table width="100%" cellspacing="10">
684 <tr><td width="33%"><%:Hostname%></td><td><%=luci.sys.hostname() or "?"%></td></tr>
685 <tr><td width="33%"><%:Model%></td><td><%=pcdata(boardinfo.model or boardinfo.system or "?")%></td></tr>
686 <tr><td width="33%"><%:Firmware Version%></td><td>
687 <%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%> /
688 <%=pcdata(ver.luciname)%> (<%=pcdata(ver.luciversion)%>)
690 <tr><td width="33%"><%:Kernel Version%></td><td><%=unameinfo.release or "?"%></td></tr>
691 <tr><td width="33%"><%:Local Time%></td><td id="localtime">-</td></tr>
692 <tr><td width="33%"><%:Uptime%></td><td id="uptime">-</td></tr>
693 <tr><td width="33%"><%:Load Average%></td><td id="loadavg">-</td></tr>
697 <fieldset class="cbi-section">
698 <legend><%:Memory%></legend>
700 <table width="100%" cellspacing="10">
701 <tr><td width="33%"><%:Total Available%></td><td id="memtotal">-</td></tr>
702 <tr><td width="33%"><%:Free%></td><td id="memfree">-</td></tr>
703 <tr><td width="33%"><%:Buffered%></td><td id="membuff">-</td></tr>
707 <% if swapinfo.total > 0 then %>
708 <fieldset class="cbi-section">
709 <legend><%:Swap%></legend>
711 <table width="100%" cellspacing="10">
712 <tr><td width="33%"><%:Total Available%></td><td id="swaptotal">-</td></tr>
713 <tr><td width="33%"><%:Free%></td><td id="swapfree">-</td></tr>
718 <fieldset class="cbi-section">
719 <legend><%:Network%></legend>
721 <table width="100%" cellspacing="10">
722 <tr><td width="33%" style="vertical-align:top"><%:IPv4 WAN Status%></td><td>
724 <td id="wan4_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td>
725 <td id="wan4_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td>
728 <% if has_ipv6 then %>
729 <tr><td width="33%" style="vertical-align:top"><%:IPv6 WAN Status%></td><td>
731 <td id="wan6_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td>
732 <td id="wan6_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td>
736 <tr><td width="33%"><%:Active Connections%></td><td id="conns">-</td></tr>
740 <% if has_dhcp then %>
741 <fieldset class="cbi-section">
742 <legend><%:DHCP Leases%></legend>
744 <table class="cbi-section-table" id="lease_status_table">
745 <tr class="cbi-section-table-titles">
746 <th class="cbi-section-table-cell"><%:Hostname%></th>
747 <th class="cbi-section-table-cell"><%:IPv4-Address%></th>
748 <th class="cbi-section-table-cell"><%:MAC-Address%></th>
749 <th class="cbi-section-table-cell"><%:Leasetime remaining%></th>
751 <tr class="cbi-section-table-row">
752 <td colspan="4"><em><br /><%:Collecting data...%></em></td>
757 <fieldset class="cbi-section" style="display:none">
758 <legend><%:DHCPv6 Leases%></legend>
760 <table class="cbi-section-table" id="lease6_status_table">
761 <tr class="cbi-section-table-titles">
762 <th class="cbi-section-table-cell"><%:Host%></th>
763 <th class="cbi-section-table-cell"><%:IPv6-Address%></th>
764 <th class="cbi-section-table-cell"><%:DUID%></th>
765 <th class="cbi-section-table-cell"><%:Leasetime remaining%></th>
767 <tr class="cbi-section-table-row">
768 <td colspan="4"><em><br /><%:Collecting data...%></em></td>
774 <% if has_dsl then %>
775 <fieldset class="cbi-section">
776 <legend><%:DSL%></legend>
777 <table width="100%" cellspacing="10">
778 <tr><td width="33%" style="vertical-align:top"><%:DSL Status%></td><td>
780 <td id="dsl_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></td>
781 <td id="dsl_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></td>
788 <% if has_wifi then %>
789 <fieldset class="cbi-section">
790 <legend><%:Wireless%></legend>
792 <table id="wifi_status_table" width="100%" cellspacing="10">
793 <tr><td><em><%:Collecting data...%></em></td></tr>
797 <fieldset class="cbi-section">
798 <legend><%:Associated Stations%></legend>
800 <table class="cbi-section-table valign-middle" id="wifi_assoc_table">
801 <tr class="cbi-section-table-titles">
802 <th class="cbi-section-table-cell"> </th>
803 <th class="cbi-section-table-cell"><%:Network%></th>
804 <th class="cbi-section-table-cell"><%:MAC-Address%></th>
805 <th class="cbi-section-table-cell"><%:Host%></th>
806 <th class="cbi-section-table-cell"><%:Signal%> / <%:Noise%></th>
807 <th class="cbi-section-table-cell"><%:RX Rate%> / <%:TX Rate%></th>
809 <tr class="cbi-section-table-row">
810 <td colspan="6"><em><br /><%:Collecting data...%></em></td>
817 local incdir = util.libpath() .. "/view/admin_status/index/"
818 if fs.access(incdir) then
820 for inc in fs.dir(incdir) do
821 if inc:match("%.htm$") then
822 include("admin_status/index/" .. inc:gsub("%.htm$", ""))