applications/luci-ahcp: rework status javascript to use XHR.poll()

This commit is contained in:
Jo-Philipp Wich 2011-09-26 00:26:19 +00:00
parent fa52f7f54b
commit 97f74fe766

View file

@ -1,9 +1,5 @@
<script type="text/javascript">//<![CDATA[ <script type="text/javascript">//<![CDATA[
var stxhr = new XHR(); XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "ahcpd", "status")%>', null,
(function() {
var func = arguments.callee;
stxhr.get('<%=luci.dispatcher.build_url("admin", "network", "ahcpd", "status")%>', null,
function(x, st) function(x, st)
{ {
var tb = document.getElementById('ahcpd_status_table'); var tb = document.getElementById('ahcpd_status_table');
@ -38,11 +34,8 @@
else else
tx.innerHTML = String.format('The AHCP Service is running with ID %s.', st.uid); tx.innerHTML = String.format('The AHCP Service is running with ID %s.', st.uid);
} }
window.setTimeout(func, 5000);
} }
) );
})();
//]]></script> //]]></script>
<fieldset class="cbi-section"> <fieldset class="cbi-section">