1 <script type=
"text/javascript">//<![CDATA[
5 var func = arguments.callee;
7 stxhr.get('<%=luci.dispatcher.build_url(
"admin",
"network",
"dhcplease_status")%
>', null,
10 var tb = document.getElementById('lease_status_table');
14 while( tb.rows.length
> 1 )
17 for( var i =
0; i < st.length; i++ )
21 if (st[i].expires <=
0)
23 timestr = '
<em><%:expired%
></em>';
27 timestr = String.format('%t', st[i].expires);
30 var tr = tb.insertRow(-
1);
31 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i %
2) +
1);
33 tr.insertCell(-
1).innerHTML = st[i].hostname ? st[i].hostname : '?';
34 tr.insertCell(-
1).innerHTML = st[i].ipaddr;
35 tr.insertCell(-
1).innerHTML = st[i].macaddr;
36 tr.insertCell(-
1).innerHTML = timestr;
39 if( tb.rows.length ==
1 )
41 var tr = tb.insertRow(-
1);
42 tr.className = 'cbi-section-table-row';
44 var td = tr.insertCell(-
1);
46 td.innerHTML = '
<em><br /><%:There are no active leases.%
></em>';
50 window.setTimeout(func,
5000);
56 <fieldset class=
"cbi-section">
57 <legend><%:Active Leases%
></legend>
58 <table class=
"cbi-section-table" id=
"lease_status_table">
59 <tr class=
"cbi-section-table-titles">
60 <th class=
"cbi-section-table-cell"><%:Hostname%
></th>
61 <th class=
"cbi-section-table-cell"><%:IPv4-Address%
></th>
62 <th class=
"cbi-section-table-cell"><%:MAC-Address%
></th>
63 <th class=
"cbi-section-table-cell"><%:Leasetime remaining%
></th>
65 <tr class=
"cbi-section-table-row">
66 <td colspan=
"4"><em><br /><%:Collecting data...%
></em></td>