Merge pull request #1915 from Ansuel/upgrade
[project/luci.git] / modules / luci-mod-admin-full / luasrc / view / admin_status / index.htm
1 <%#
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.
5 -%>
6
7 <%
8 local fs = require "nixio.fs"
9 local ipc = require "luci.ip"
10 local util = require "luci.util"
11 local stat = require "luci.tools.status"
12 local ver = require "luci.version"
13
14 local has_ipv6 = fs.access("/proc/net/ipv6_route")
15 local has_dhcp = fs.access("/etc/config/dhcp")
16 local has_wifi = ((fs.stat("/etc/config/wireless", "size") or 0) > 0)
17
18 local sysinfo = luci.util.ubus("system", "info") or { }
19 local boardinfo = luci.util.ubus("system", "board") or { }
20 local unameinfo = nixio.uname() or { }
21
22 local meminfo = sysinfo.memory or {
23 total = 0,
24 free = 0,
25 buffered = 0,
26 shared = 0
27 }
28
29 local swapinfo = sysinfo.swap or {
30 total = 0,
31 free = 0
32 }
33
34 local has_dsl = fs.access("/etc/init.d/dsl_control")
35
36 if luci.http.formvalue("status") == "1" then
37 local ntm = require "luci.model.network".init()
38 local wan = ntm:get_wannet()
39 local wan6 = ntm:get_wan6net()
40
41 local conn_count = tonumber(
42 fs.readfile("/proc/sys/net/netfilter/nf_conntrack_count") or "") or 0
43
44 local conn_max = tonumber(luci.sys.exec(
45 "sysctl -n -e net.nf_conntrack_max net.ipv4.netfilter.ip_conntrack_max"
46 ):match("%d+")) or 4096
47
48 local rv = {
49 uptime = sysinfo.uptime or 0,
50 localtime = os.date(),
51 loadavg = sysinfo.load or { 0, 0, 0 },
52 memory = meminfo,
53 swap = swapinfo,
54 connmax = conn_max,
55 conncount = conn_count,
56 leases = stat.dhcp_leases(),
57 leases6 = stat.dhcp6_leases(),
58 wifinets = stat.wifi_networks()
59 }
60
61 if wan then
62 local dev = wan:get_interface()
63 local link = dev and ipc.link(dev:name())
64 rv.wan = {
65 ipaddr = wan:ipaddr(),
66 gwaddr = wan:gwaddr(),
67 netmask = wan:netmask(),
68 dns = wan:dnsaddrs(),
69 expires = wan:expires(),
70 uptime = wan:uptime(),
71 proto = wan:proto(),
72 i18n = wan:get_i18n(),
73 ifname = wan:ifname(),
74 link = wan:adminlink(),
75 mac = dev and dev:mac(),
76 type = dev and dev:type(),
77 name = dev and dev:get_i18n(),
78 ether = link and link.type == 1
79 }
80 end
81
82 if wan6 then
83 local dev = wan6:get_interface()
84 local link = dev and ipc.link(dev:name())
85 rv.wan6 = {
86 ip6addr = wan6:ip6addr(),
87 gw6addr = wan6:gw6addr(),
88 dns = wan6:dns6addrs(),
89 ip6prefix = wan6:ip6prefix(),
90 uptime = wan6:uptime(),
91 proto = wan6:proto(),
92 i18n = wan6:get_i18n(),
93 ifname = wan6:ifname(),
94 link = wan6:adminlink(),
95 mac = dev and dev:mac(),
96 type = dev and dev:type(),
97 name = dev and dev:get_i18n(),
98 ether = link and link.type == 1
99 }
100 end
101
102 if has_dsl then
103 local dsl_stat = luci.sys.exec("/etc/init.d/dsl_control lucistat")
104 local dsl_func = loadstring(dsl_stat)
105 if dsl_func then
106 rv.dsl = dsl_func()
107 end
108 end
109
110 luci.http.prepare_content("application/json")
111 luci.http.write_json(rv)
112
113 return
114 elseif luci.http.formvalue("hosts") == "1" then
115 luci.http.prepare_content("application/json")
116 luci.http.write_json(luci.sys.net.host_hints())
117
118 return
119 end
120 -%>
121
122 <%+header%>
123
124 <script type="text/javascript" src="<%=resource%>/cbi.js"></script>
125 <script type="text/javascript">//<![CDATA[
126 function progressbar(v, m)
127 {
128 var vn = parseInt(v) || 0;
129 var mn = parseInt(m) || 100;
130 var pc = Math.floor((100 / mn) * vn);
131
132 return String.format(
133 '<div style="width:100%%; max-width:200px; position:relative; border:1px solid #999999">' +
134 '<div style="background-color:#CCCCCC; width:%d%%; height:15px">' +
135 '<div style="position:absolute; left:0; top:0; text-align:center; width:100%%; color:#000000">' +
136 '<small>%s / %s (%d%%)</small>' +
137 '</div>' +
138 '</div>' +
139 '</div>', pc, v, m, pc
140 );
141 }
142
143 function duid2mac(duid) {
144 // DUID-LLT / Ethernet
145 if (duid.length === 28 && duid.substr(0, 8) === '00010001')
146 return duid.substr(16).replace(/(..)(?=..)/g, '$1:').toUpperCase();
147
148 // DUID-LL / Ethernet
149 if (duid.length === 20 && duid.substr(0, 8) === '00030001')
150 return duid.substr(8).replace(/(..)(?=..)/g, '$1:').toUpperCase();
151
152 return null;
153 }
154
155 var npoll = 1;
156 var hosts = <%=luci.http.write_json(luci.sys.net.host_hints())%>;
157
158 function updateHosts() {
159 XHR.get('<%=REQUEST_URI%>', { hosts: 1 }, function(x, data) {
160 hosts = data;
161 });
162 }
163
164 function labelList(items, offset) {
165 var rv = [ ];
166
167 for (var i = offset || 0; i < items.length; i += 2) {
168 var label = items[i],
169 value = items[i+1];
170
171 if (value === undefined || value === null)
172 continue;
173
174 if (label)
175 rv.push(E('strong', [label, ': ']));
176
177 rv.push(value, E('br'));
178 }
179
180 return rv;
181 }
182
183 function renderBox(title, active, childs) {
184 childs = childs || [];
185 childs.unshift(E('span', labelList(arguments, 3)));
186
187 return E('div', { class: 'ifacebox' }, [
188 E('div', { class: 'ifacebox-head center ' + (active ? 'active' : '') },
189 E('strong', title)),
190 E('div', { class: 'ifacebox-body left' }, childs)
191 ]);
192 }
193
194 function renderBadge(icon, title) {
195 return E('span', { class: 'ifacebadge' }, [
196 E('img', { src: icon, title: title || '' }),
197 E('span', labelList(arguments, 2))
198 ]);
199 }
200
201 XHR.poll(5, '<%=REQUEST_URI%>', { status: 1 },
202 function(x, info)
203 {
204 if (!(npoll++ % 5))
205 updateHosts();
206
207 var us = document.getElementById('upstream_status_table');
208
209 while (us.lastElementChild)
210 us.removeChild(us.lastElementChild);
211
212 var ifc = info.wan || {};
213
214 us.appendChild(renderBox(
215 '<%:IPv4 Upstream%>',
216 (ifc.ifname && ifc.proto != 'none'),
217 [ E('div', {}, renderBadge(
218 '<%=resource%>/icons/%s.png'.format((ifc && ifc.type) ? ifc.type : 'ethernet_disabled'), null,
219 '<%:Device%>', ifc ? (ifc.name || ifc.ifname || '-') : '-',
220 '<%:MAC-Address%>', (ifc && ifc.ether) ? ifc.mac : null)) ],
221 '<%:Protocol%>', ifc.i18n || E('em', '<%:Not connected%>'),
222 '<%:Address%>', (ifc.ipaddr) ? ifc.ipaddr : '0.0.0.0',
223 '<%:Netmask%>', (ifc.netmask && ifc.netmask != ifc.ipaddr) ? ifc.netmask : '255.255.255.255',
224 '<%:Gateway%>', (ifc.gwaddr) ? ifc.gwaddr : '0.0.0.0',
225 '<%:DNS%> 1', (ifc.dns) ? ifc.dns[0] : null,
226 '<%:DNS%> 2', (ifc.dns) ? ifc.dns[1] : null,
227 '<%:DNS%> 3', (ifc.dns) ? ifc.dns[2] : null,
228 '<%:DNS%> 4', (ifc.dns) ? ifc.dns[3] : null,
229 '<%:DNS%> 5', (ifc.dns) ? ifc.dns[4] : null,
230 '<%:Expires%>', (ifc.expires > -1) ? '%t'.format(ifc.expires) : null,
231 '<%:Connected%>', (ifc.uptime > 0) ? '%t'.format(ifc.uptime) : null));
232
233 <% if has_ipv6 then %>
234 var ifc6 = info.wan6 || {};
235
236 us.appendChild(renderBox(
237 '<%:IPv6 Upstream%>',
238 (ifc6.ifname && ifc6.proto != 'none'),
239 [ E('div', {}, renderBadge(
240 '<%=resource%>/icons/%s.png'.format(ifc6.type || 'ethernet_disabled'), null,
241 '<%:Device%>', ifc6 ? (ifc6.name || ifc6.ifname || '-') : '-',
242 '<%:MAC-Address%>', (ifc6 && ifc6.ether) ? ifc6.mac : null)) ],
243 '<%:Protocol%>', ifc6.i18n ? (ifc6.i18n + (ifc6.proto === 'dhcp' && ifc6.ip6prefix ? '-PD' : '')) : E('em', '<%:Not connected%>'),
244 '<%:Prefix Delegated%>', ifc6.ip6prefix,
245 '<%:Address%>', (ifc6.ip6prefix) ? (ifc6.ip6addr || null) : (ifc6.ipaddr || '::'),
246 '<%:Gateway%>', (ifc6.gw6addr) ? ifc6.gw6addr : '::',
247 '<%:DNS%> 1', (ifc6.dns) ? ifc6.dns[0] : null,
248 '<%:DNS%> 2', (ifc6.dns) ? ifc6.dns[1] : null,
249 '<%:DNS%> 3', (ifc6.dns) ? ifc6.dns[2] : null,
250 '<%:DNS%> 4', (ifc6.dns) ? ifc6.dns[3] : null,
251 '<%:DNS%> 5', (ifc6.dns) ? ifc6.dns[4] : null,
252 '<%:Connected%>', (ifc6.uptime > 0) ? '%t'.format(ifc6.uptime) : null));
253 <% end %>
254
255 <% if has_dsl then %>
256 var dsl_i = document.getElementById('dsl_i');
257 var dsl_s = document.getElementById('dsl_s');
258
259 var s = String.format(
260 '<strong><%:Status%>: </strong>%s<br />' +
261 '<strong><%:Line State%>: </strong>%s [0x%x]<br />' +
262 '<strong><%:Line Mode%>: </strong>%s<br />' +
263 '<strong><%:Annex%>: </strong>%s<br />' +
264 '<strong><%:Profile%>: </strong>%s<br />' +
265 '<strong><%:Data Rate%>: </strong>%s/s / %s/s<br />' +
266 '<strong><%:Max. Attainable Data Rate (ATTNDR)%>: </strong>%s/s / %s/s<br />' +
267 '<strong><%:Latency%>: </strong>%s / %s<br />' +
268 '<strong><%:Line Attenuation (LATN)%>: </strong>%s dB / %s dB<br />' +
269 '<strong><%:Signal Attenuation (SATN)%>: </strong>%s dB / %s dB<br />' +
270 '<strong><%:Noise Margin (SNR)%>: </strong>%s dB / %s dB<br />' +
271 '<strong><%:Aggregate Transmit Power(ACTATP)%>: </strong>%s dB / %s dB<br />' +
272 '<strong><%:Forward Error Correction Seconds (FECS)%>: </strong>%s / %s<br />' +
273 '<strong><%:Errored seconds (ES)%>: </strong>%s / %s<br />' +
274 '<strong><%:Severely Errored Seconds (SES)%>: </strong>%s / %s<br />' +
275 '<strong><%:Loss of Signal Seconds (LOSS)%>: </strong>%s / %s<br />' +
276 '<strong><%:Unavailable Seconds (UAS)%>: </strong>%s / %s<br />' +
277 '<strong><%:Header Error Code Errors (HEC)%>: </strong>%s / %s<br />' +
278 '<strong><%:Non Pre-emtive CRC errors (CRC_P)%>: </strong>%s / %s<br />' +
279 '<strong><%:Pre-emtive CRC errors (CRCP_P)%>: </strong>%s / %s<br />' +
280 '<strong><%:Line Uptime%>: </strong>%s<br />' +
281 '<strong><%:ATU-C System Vendor ID%>: </strong>%s<br />' +
282 '<strong><%:Power Management Mode%>: </strong>%s<br />',
283 info.dsl.line_state, info.dsl.line_state_detail,
284 info.dsl.line_state_num,
285 info.dsl.line_mode_s,
286 info.dsl.annex_s,
287 info.dsl.profile_s,
288 info.dsl.data_rate_down_s, info.dsl.data_rate_up_s,
289 info.dsl.max_data_rate_down_s, info.dsl.max_data_rate_up_s,
290 info.dsl.latency_num_down, info.dsl.latency_num_up,
291 info.dsl.line_attenuation_down, info.dsl.line_attenuation_up,
292 info.dsl.signal_attenuation_down, info.dsl.signal_attenuation_up,
293 info.dsl.noise_margin_down, info.dsl.noise_margin_up,
294 info.dsl.actatp_down, info.dsl.actatp_up,
295 info.dsl.errors_fec_near, info.dsl.errors_fec_far,
296 info.dsl.errors_es_near, info.dsl.errors_es_far,
297 info.dsl.errors_ses_near, info.dsl.errors_ses_far,
298 info.dsl.errors_loss_near, info.dsl.errors_loss_far,
299 info.dsl.errors_uas_near, info.dsl.errors_uas_far,
300 info.dsl.errors_hec_near, info.dsl.errors_hec_far,
301 info.dsl.errors_crc_p_near, info.dsl.errors_crc_p_far,
302 info.dsl.errors_crcp_p_near, info.dsl.errors_crcp_p_far,
303 info.dsl.line_uptime_s,
304 info.dsl.atuc_vendor_id,
305 info.dsl.power_mode_s
306 );
307
308 dsl_s.innerHTML = String.format('<small>%s</small>', s);
309 dsl_i.innerHTML = String.format(
310 '<img src="<%=resource%>/icons/ethernet.png" />' +
311 '<br /><small>DSL</small>'
312 );
313 <% end %>
314
315 <% if has_dhcp then %>
316 var ls = document.getElementById('lease_status_table');
317 if (ls)
318 {
319 var rows = [];
320
321 for (var i = 0; i < info.leases.length; i++)
322 {
323 var timestr;
324
325 if (info.leases[i].expires === false)
326 timestr = '<em><%:unlimited%></em>';
327 else if (info.leases[i].expires <= 0)
328 timestr = '<em><%:expired%></em>';
329 else
330 timestr = String.format('%t', info.leases[i].expires);
331
332 rows.push([
333 info.leases[i].hostname ? info.leases[i].hostname : '?',
334 info.leases[i].ipaddr,
335 info.leases[i].macaddr,
336 timestr
337 ]);
338 }
339
340 cbi_update_table(ls, rows, '<em><%:There are no active leases.%></em>');
341 }
342
343 var ls6 = document.getElementById('lease6_status_table');
344 if (ls6 && info.leases6)
345 {
346 ls6.parentNode.parentNode.style.display = 'block';
347
348 var rows = [];
349
350 for (var i = 0; i < info.leases6.length; i++)
351 {
352 var timestr;
353
354 if (info.leases6[i].expires === false)
355 timestr = '<em><%:unlimited%></em>';
356 else if (info.leases6[i].expires <= 0)
357 timestr = '<em><%:expired%></em>';
358 else
359 timestr = String.format('%t', info.leases6[i].expires);
360
361 var host = hosts[duid2mac(info.leases6[i].duid)],
362 name = info.leases6[i].hostname,
363 hint = null;
364
365 if (!name) {
366 if (host)
367 hint = host.name || host.ipv4 || host.ipv6;
368 }
369 else {
370 if (host && host.name && info.leases6[i].hostname != host.name)
371 hint = host.name;
372 }
373
374 rows.push([
375 hint ? '%h (%h)'.format(name || '?', hint) : (name || '?'),
376 info.leases6[i].ip6addr,
377 info.leases6[i].duid,
378 timestr
379 ]);
380 }
381
382 cbi_update_table(ls6, rows, '<em><%:There are no active leases.%></em>');
383 }
384 <% end %>
385
386 <% if has_wifi then %>
387 var ws = document.getElementById('wifi_status_table');
388 if (ws)
389 {
390 while (ws.lastElementChild)
391 ws.removeChild(ws.lastElementChild);
392
393 for (var didx = 0; didx < info.wifinets.length; didx++)
394 {
395 var dev = info.wifinets[didx];
396 var net0 = (dev.networks && dev.networks[0]) ? dev.networks[0] : {};
397 var vifs = [];
398
399 for (var nidx = 0; nidx < dev.networks.length; nidx++)
400 {
401 var net = dev.networks[nidx];
402 var is_assoc = (net.bssid != '00:00:00:00:00:00' && net.channel && !net.disabled);
403
404 var icon;
405 if (!is_assoc)
406 icon = "<%=resource%>/icons/signal-none.png";
407 else if (net.quality == 0)
408 icon = "<%=resource%>/icons/signal-0.png";
409 else if (net.quality < 25)
410 icon = "<%=resource%>/icons/signal-0-25.png";
411 else if (net.quality < 50)
412 icon = "<%=resource%>/icons/signal-25-50.png";
413 else if (net.quality < 75)
414 icon = "<%=resource%>/icons/signal-50-75.png";
415 else
416 icon = "<%=resource%>/icons/signal-75-100.png";
417
418 vifs.push(renderBadge(
419 icon,
420 '<%:Signal%>: %d dBm / <%:Quality%>: %d%%'.format(net.signal, net.quality),
421 '<%:SSID%>', E('a', { href: net.link }, [ net.ssid || '?' ]),
422 '<%:Mode%>', net.mode,
423 '<%:BSSID%>', is_assoc ? (net.bssid || '-') : null,
424 '<%:Encryption%>', is_assoc ? net.encryption : null,
425 '<%:Associations%>', is_assoc ? (net.num_assoc || '-') : null,
426 null, is_assoc ? null : E('em', '<%:Wireless is disabled or not associated%>')));
427 }
428
429 ws.appendChild(renderBox(
430 dev.device, dev.up || net0.up,
431 [ E('div', vifs) ],
432 '<%:Type%>', dev.name.replace(/^Generic | Wireless Controller .+$/g, ''),
433 '<%:Channel%>', net0.channel ? '%d (%.3f <%:GHz%>)'.format(net0.channel, net0.frequency) : '-',
434 '<%:Bitrate%>', net0.bitrate ? '%d <%:Mbit/s%>'.format(net0.bitrate) : '-'));
435 }
436
437 if (!ws.lastElementChild)
438 ws.appendChild(E('<em><%:No information available%></em>'));
439 }
440 <% end %>
441
442 var e;
443
444 if (e = document.getElementById('localtime'))
445 e.innerHTML = info.localtime;
446
447 if (e = document.getElementById('uptime'))
448 e.innerHTML = String.format('%t', info.uptime);
449
450 if (e = document.getElementById('loadavg'))
451 e.innerHTML = String.format(
452 '%.02f, %.02f, %.02f',
453 info.loadavg[0] / 65535.0,
454 info.loadavg[1] / 65535.0,
455 info.loadavg[2] / 65535.0
456 );
457
458 if (e = document.getElementById('memtotal'))
459 e.innerHTML = progressbar(
460 ((info.memory.free + info.memory.buffered) / 1024) + " <%:kB%>",
461 (info.memory.total / 1024) + " <%:kB%>"
462 );
463
464 if (e = document.getElementById('memfree'))
465 e.innerHTML = progressbar(
466 (info.memory.free / 1024) + " <%:kB%>",
467 (info.memory.total / 1024) + " <%:kB%>"
468 );
469
470 if (e = document.getElementById('membuff'))
471 e.innerHTML = progressbar(
472 (info.memory.buffered / 1024) + " <%:kB%>",
473 (info.memory.total / 1024) + " <%:kB%>"
474 );
475
476 if (e = document.getElementById('swaptotal'))
477 e.innerHTML = progressbar(
478 (info.swap.free / 1024) + " <%:kB%>",
479 (info.swap.total / 1024) + " <%:kB%>"
480 );
481
482 if (e = document.getElementById('swapfree'))
483 e.innerHTML = progressbar(
484 (info.swap.free / 1024) + " <%:kB%>",
485 (info.swap.total / 1024) + " <%:kB%>"
486 );
487
488 if (e = document.getElementById('conns'))
489 e.innerHTML = progressbar(info.conncount, info.connmax);
490
491 }
492 );
493 //]]></script>
494
495 <h2 name="content"><%:Status%></h2>
496
497 <div class="cbi-section">
498 <h3><%:System%></h3>
499
500 <div class="table" width="100%">
501 <div class="tr"><div class="td left" width="33%"><%:Hostname%></div><div class="td left"><%=luci.sys.hostname() or "?"%></div></div>
502 <div class="tr"><div class="td left" width="33%"><%:Model%></div><div class="td left"><%=pcdata(boardinfo.model or "?")%></div></div>
503 <div class="tr"><div class="td left" width="33%"><%:Architecture%></div><div class="td left"><%=pcdata(boardinfo.system or "?")%></div></div>
504 <div class="tr"><div class="td left" width="33%"><%:Firmware Version%></div><div class="td left">
505 <%=pcdata(ver.distname)%> <%=pcdata(ver.distversion)%> /
506 <%=pcdata(ver.luciname)%> (<%=pcdata(ver.luciversion)%>)
507 </div></div>
508 <div class="tr"><div class="td left" width="33%"><%:Kernel Version%></div><div class="td left"><%=unameinfo.release or "?"%></div></div>
509 <div class="tr"><div class="td left" width="33%"><%:Local Time%></div><div class="td left" id="localtime">-</div></div>
510 <div class="tr"><div class="td left" width="33%"><%:Uptime%></div><div class="td left" id="uptime">-</div></div>
511 <div class="tr"><div class="td left" width="33%"><%:Load Average%></div><div class="td left" id="loadavg">-</div></div>
512 </div>
513 </div>
514
515 <div class="cbi-section">
516 <h3><%:Memory%></h3>
517
518 <div class="table" width="100%">
519 <div class="tr"><div class="td left" width="33%"><%:Total Available%></div><div class="td left" id="memtotal">-</div></div>
520 <div class="tr"><div class="td left" width="33%"><%:Free%></div><div class="td left" id="memfree">-</div></div>
521 <div class="tr"><div class="td left" width="33%"><%:Buffered%></div><div class="td left" id="membuff">-</div></div>
522 </div>
523 </div>
524
525 <% if swapinfo.total > 0 then %>
526 <div class="cbi-section">
527 <h3><%:Swap%></h3>
528
529 <div class="table" width="100%">
530 <div class="tr"><div class="td left" width="33%"><%:Total Available%></div><div class="td left" id="swaptotal">-</div></div>
531 <div class="tr"><div class="td left" width="33%"><%:Free%></div><div class="td left" id="swapfree">-</div></div>
532 </div>
533 </div>
534 <% end %>
535
536 <div class="cbi-section">
537 <h3><%:Network%></h3>
538
539 <div id="upstream_status_table" class="network-status-table">
540 <em><%:Collecting data...%></em>
541 </div>
542
543 <div class="table" width="100%">
544 <div class="tr"><div class="td left" width="33%"><%:Active Connections%></div><div class="td left" id="conns">-</div></div>
545 </div>
546 </div>
547
548 <% if has_dhcp then %>
549 <div class="cbi-section">
550 <h3><%:DHCP Leases%></h3>
551
552 <div class="cbi-section-node">
553 <div class="table" id="lease_status_table">
554 <div class="tr table-titles">
555 <div class="th"><%:Hostname%></div>
556 <div class="th"><%:IPv4-Address%></div>
557 <div class="th"><%:MAC-Address%></div>
558 <div class="th"><%:Leasetime remaining%></div>
559 </div>
560 <div class="tr cbi-section-table-row">
561 <div class="td" colspan="4"><em><br /><%:Collecting data...%></em></div>
562 </div>
563 </div>
564 </div>
565 </div>
566
567 <div class="cbi-section" style="display:none">
568 <h3><%:DHCPv6 Leases%></h3>
569
570 <div class="cbi-section-node">
571 <div class="table" id="lease6_status_table">
572 <div class="tr table-titles">
573 <div class="th"><%:Host%></div>
574 <div class="th"><%:IPv6-Address%></div>
575 <div class="th"><%:DUID%></div>
576 <div class="th"><%:Leasetime remaining%></div>
577 </div>
578 <div class="tr cbi-section-table-row">
579 <div class="td" colspan="4"><em><br /><%:Collecting data...%></em></div>
580 </div>
581 </div>
582 </div>
583 </div>
584 <% end %>
585
586 <% if has_dsl then %>
587 <div class="cbi-section">
588 <h3><%:DSL%></h3>
589
590 <div class="cbi-section-node">
591 <div class="table" width="100%">
592 <div class="tr">
593 <div class="td left" width="33%" style="vertical-align:top"><%:DSL Status%></div>
594 <div class="td">
595 <div class="table">
596 <div class="tr">
597 <div class="td" id="dsl_i" style="width:16px; text-align:center; padding:3px"><img src="<%=resource%>/icons/ethernet_disabled.png" /><br /><small>?</small></div>
598 <div class="td left" id="dsl_s" style="vertical-align:middle; padding: 3px"><em><%:Collecting data...%></em></div>
599 </div>
600 </div>
601 </div>
602 </div>
603 </div>
604 </div>
605 </div>
606 <% end %>
607
608 <% if has_wifi then %>
609 <div class="cbi-section">
610 <h3><%:Wireless%></h3>
611
612 <div id="wifi_status_table" class="network-status-table">
613 <em><%:Collecting data...%></em>
614 </div>
615 </div>
616
617 <div class="cbi-section">
618 <h3><%:Associated Stations%></h3>
619
620 <%+admin_network/wifi_assoclist%>
621 </div>
622 <% end %>
623
624 <%-
625 local incdir = util.libpath() .. "/view/admin_status/index/"
626 if fs.access(incdir) then
627 local inc
628 for inc in fs.dir(incdir) do
629 if inc:match("%.htm$") then
630 include("admin_status/index/" .. inc:gsub("%.htm$", ""))
631 end
632 end
633 end
634 -%>
635
636 <%+footer%>