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[
0].length; i++ )
16 if (st[
0][i].expires <=
0)
18 timestr = '
<em><%:expired%
></em>';
22 timestr = String.format('%t', st[
0][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[
0][i].hostname ? st[
0][i].hostname : '?';
29 tr.insertCell(-
1).innerHTML = st[
0][i].ipaddr;
30 tr.insertCell(-
1).innerHTML = st[
0][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>';
45 var tb6 = document.getElementById('lease6_status_table');
46 if (st && st[
1] && tb6)
48 tb6.parentNode.style.display = 'block';
51 while( tb6.rows.length
> 1 )
54 for( var i =
0; i < st[
1].length; i++ )
58 if (st[
1][i].expires <=
0)
60 timestr = '
<em><%:expired%
></em>';
64 timestr = String.format('%t', st[
1][i].expires);
67 var tr = tb6.insertRow(-
1);
68 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i %
2) +
1);
70 tr.insertCell(-
1).innerHTML = st[
1][i].hostname ? st[
1][i].hostname : '?';
71 tr.insertCell(-
1).innerHTML = st[
1][i].ip6addr;
72 tr.insertCell(-
1).innerHTML = st[
1][i].duid;
73 tr.insertCell(-
1).innerHTML = timestr;
76 if( tb6.rows.length ==
1 )
78 var tr = tb6.insertRow(-
1);
79 tr.className = 'cbi-section-table-row';
81 var td = tr.insertCell(-
1);
83 td.innerHTML = '
<em><br /><%:There are no active leases.%
></em>';
90 <fieldset class=
"cbi-section">
91 <legend><%:Active DHCP Leases%
></legend>
92 <table class=
"cbi-section-table" id=
"lease_status_table">
93 <tr class=
"cbi-section-table-titles">
94 <th class=
"cbi-section-table-cell"><%:Hostname%
></th>
95 <th class=
"cbi-section-table-cell"><%:IPv4-Address%
></th>
96 <th class=
"cbi-section-table-cell"><%:MAC-Address%
></th>
97 <th class=
"cbi-section-table-cell"><%:Leasetime remaining%
></th>
99 <tr class=
"cbi-section-table-row">
100 <td colspan=
"4"><em><br /><%:Collecting data...%
></em></td>
105 <fieldset class=
"cbi-section" style=
"display:none">
106 <legend><%:Active DHCPv6 Leases%
></legend>
107 <table class=
"cbi-section-table" id=
"lease6_status_table">
108 <tr class=
"cbi-section-table-titles">
109 <th class=
"cbi-section-table-cell"><%:Hostname%
></th>
110 <th class=
"cbi-section-table-cell"><%:IPv6-Address%
></th>
111 <th class=
"cbi-section-table-cell"><%:DUID%
></th>
112 <th class=
"cbi-section-table-cell"><%:Leasetime remaining%
></th>
114 <tr class=
"cbi-section-table-row">
115 <td colspan=
"4"><em><br /><%:Collecting data...%
></em></td>