1 <script type="text/javascript">//<![CDATA[
2 XHR.poll(-1, '<%=url('admin/dhcplease_status')%>', null,
5 var tb = document.getElementById('lease_status_table');
10 for (var i = 0; i < st[0].length; i++)
14 if (st[0][i].expires === false)
15 timestr = '<em><%:unlimited%></em>';
16 else if (st[0][i].expires <= 0)
17 timestr = '<em><%:expired%></em>';
19 timestr = String.format('%t', st[0][i].expires);
22 st[0][i].hostname || '?',
29 cbi_update_table(tb, rows, '<em><%:There are no active leases.%></em>');
32 var tb6 = document.getElementById('lease6_status_table');
33 if (st && st[1] && tb6)
35 tb6.parentNode.style.display = 'block';
39 for (var i = 0; i < st[1].length; i++)
43 if (st[1][i].expires === false)
44 timestr = '<em><%:unlimited%></em>';
45 else if (st[1][i].expires <= 0)
46 timestr = '<em><%:expired%></em>';
48 timestr = String.format('%t', st[1][i].expires);
50 var name = st[1][i].hostname,
51 hint = st[1][i].host_hint;
54 hint ? '%h (%h)'.format(name || '?', hint) : (name || '?'),
61 cbi_update_table(tb6, rows, '<em><%:There are no active leases.%></em>');
67 <div class="cbi-section">
68 <h3><%:Active DHCP Leases%></h3>
69 <div class="table" id="lease_status_table">
70 <div class="tr table-titles">
71 <div class="th"><%:Hostname%></div>
72 <div class="th"><%:IPv4-Address%></div>
73 <div class="th"><%:MAC-Address%></div>
74 <div class="th"><%:Leasetime remaining%></div>
76 <div class="tr placeholder">
77 <div class="td"><em><%:Collecting data...%></em></div>
82 <div class="cbi-section" style="display:none">
83 <h3><%:Active DHCPv6 Leases%></h3>
84 <div class="table" id="lease6_status_table">
85 <div class="tr table-titles">
86 <div class="th"><%:Host%></div>
87 <div class="th"><%:IPv6-Address%></div>
88 <div class="th"><%:DUID%></div>
89 <div class="th"><%:Leasetime remaining%></div>
91 <div class="tr placeholder">
92 <div class="td"><em><%:Collecting data...%></em></div>