1 <script type="text/javascript">//<![CDATA[
4 var func = arguments.callee;
6 stxhr.get('<%=luci.dispatcher.build_url("admin", "network", "ahcpd", "status")%>', null,
9 var tb = document.getElementById('ahcpd_status_table');
10 var tx = document.getElementById('ahcpd_status_text');
14 while( tb.rows.length > 1 )
17 for( var i = 0; i < st.leases.length; i++ )
19 var tr = tb.insertRow(-1);
20 tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1);
22 tr.insertCell(-1).innerHTML = st.leases[i].addr;
23 tr.insertCell(-1).innerHTML = String.format('%t', st.leases[i].age);
26 if( tb.rows.length == 1 )
28 var tr = tb.insertRow(-1);
29 tr.className = 'cbi-section-table-row';
31 var td = tr.insertCell(-1);
33 td.innerHTML = '<em><br /><%:There are no active leases.%></em>';
36 if( st.uid == '00:00:00:00:00:00:00:00' )
37 tx.innerHTML = 'The AHCP Service is not running.';
39 tx.innerHTML = String.format('The AHCP Service is running with ID %s.', st.uid);
42 window.setTimeout(func, 5000);
48 <fieldset class="cbi-section">
49 <legend><%:Active AHCP Leases%></legend>
50 <p id="ahcpd_status_text"></p>
51 <table class="cbi-section-table" id="ahcpd_status_table">
52 <tr class="cbi-section-table-titles">
53 <th class="cbi-section-table-cell"><%:Address%></th>
54 <th class="cbi-section-table-cell"><%:Age%></th>
56 <tr class="cbi-section-table-row">
57 <td colspan="5"><em><br /><%:Collecting data...%></em></td>