1 <script type="text/javascript">//<![CDATA[
2 XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "dhcplease_status")%>', null,
5 var tb = document.getElementById('lease_status_table');
9 while( tb.rows.length > 1 )
12 for( var i = 0; i < st.length; i++ )
16 if (st[i].expires <= 0)
18 timestr = '<em><%:expired%></em>';
22 timestr = String.format('%t', st[i].expires);
25 var tr = tb.insertRow(-1);
26 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
28 tr.insertCell(-1).innerHTML = st[i].hostname ? st[i].hostname : '?';
29 tr.insertCell(-1).innerHTML = st[i].ipaddr;
30 tr.insertCell(-1).innerHTML = st[i].macaddr;
31 tr.insertCell(-1).innerHTML = timestr;
34 if( tb.rows.length == 1 )
36 var tr = tb.insertRow(-1);
37 tr.className = 'cbi-section-table-row';
39 var td = tr.insertCell(-1);
41 td.innerHTML = '<em><br /><%:There are no active leases.%></em>';
48 <fieldset class="cbi-section">
49 <legend><%:Active Leases%></legend>
50 <table class="cbi-section-table" id="lease_status_table">
51 <tr class="cbi-section-table-titles">
52 <th class="cbi-section-table-cell"><%:Hostname%></th>
53 <th class="cbi-section-table-cell"><%:IPv4-Address%></th>
54 <th class="cbi-section-table-cell"><%:MAC-Address%></th>
55 <th class="cbi-section-table-cell"><%:Leasetime remaining%></th>
57 <tr class="cbi-section-table-row">
58 <td colspan="4"><em><br /><%:Collecting data...%></em></td>