diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-11-17 15:23:21 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-11-17 15:23:21 +0000 |
commit | 184523b6e7f534c45e4a4a3d2151100cdba57b16 (patch) | |
tree | 02da2a2c3cf71073f0cf2a268886632914851685 | |
parent | 4121f34ac005ed0af727267fd96d9f5492664cce (diff) |
modules/admin-full: xhr fixes
5 files changed, 25 insertions, 15 deletions
diff --git a/modules/admin-full/luasrc/view/admin_network/iface_overview.htm b/modules/admin-full/luasrc/view/admin_network/iface_overview.htm index 08bac76b9..f77ee63e6 100644 --- a/modules/admin-full/luasrc/view/admin_network/iface_overview.htm +++ b/modules/admin-full/luasrc/view/admin_network/iface_overview.htm @@ -66,7 +66,7 @@ $Id$ var wifidevs = <%=luci.http.write_json(netdevs)%>; var arptable = <%=luci.http.write_json(arpcache)%>; - (function() { + var update_status = function() { iwxhr.get('<%=luci.dispatcher.build_url("admin", "network", "iface_status", table.concat(netlist, ","))%>', null, function(x, ifcs) { @@ -161,11 +161,13 @@ $Id$ } } } + + window.setTimeout(update_status, 5000); } ) + }; - window.setTimeout(arguments.callee, 5000); - })(); + update_status(); ]]></script> <fieldset class="cbi-section" style="display:none"> diff --git a/modules/admin-full/luasrc/view/admin_network/iface_status.htm b/modules/admin-full/luasrc/view/admin_network/iface_status.htm index 34e3dddfd..11590e173 100644 --- a/modules/admin-full/luasrc/view/admin_network/iface_status.htm +++ b/modules/admin-full/luasrc/view/admin_network/iface_status.htm @@ -2,7 +2,7 @@ <script type="text/javascript"><![CDATA[ var iwxhr = new XHR(); - (function() { + var update_status = function() { iwxhr.get('<%=luci.dispatcher.build_url("admin", "network", "iface_status", self.network)%>', null, function(x, ifc) { @@ -71,11 +71,13 @@ else if (d) d.innerHTML = '<%:Interface not present or not connected yet.%>'; } + + window.setTimeout(update_status, 5000); } ) + }; - window.setTimeout(arguments.callee, 5000); - })(); + update_status(); ]]></script> <table> diff --git a/modules/admin-full/luasrc/view/admin_network/lease_status.htm b/modules/admin-full/luasrc/view/admin_network/lease_status.htm index 6f90640cb..1d7c916f2 100644 --- a/modules/admin-full/luasrc/view/admin_network/lease_status.htm +++ b/modules/admin-full/luasrc/view/admin_network/lease_status.htm @@ -1,6 +1,6 @@ <script type="text/javascript"><![CDATA[ var stxhr = new XHR(); - (function() { + var update_status = function() { stxhr.get('<%=luci.dispatcher.build_url("admin", "network", "dhcplease_status")%>', null, function(x, st) { @@ -72,11 +72,13 @@ tb.rows[0].parentNode.appendChild(tr); } } + + window.setTimeout(update_status, 5000); } ) + }; - window.setTimeout(arguments.callee, 5000); - })(); + update_status(); ]]></script> <fieldset class="cbi-section"> diff --git a/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm b/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm index d47ad0856..f0d624cc2 100644 --- a/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm +++ b/modules/admin-full/luasrc/view/admin_network/wifi_overview.htm @@ -97,7 +97,7 @@ $Id$ var wifidevs = <%=luci.http.write_json(netdevs)%>; var arptable = <%=luci.http.write_json(arpcache)%>; - (function() { + var update_status = function() { iwxhr.get('<%=luci.dispatcher.build_url("admin", "network", "wireless_status", table.concat(netlist, ","))%>', null, function(x, st) { @@ -241,11 +241,13 @@ $Id$ img.src = '<%=resource%>/icons/wifi' + (devup[dev] ? '' : '_disabled') + '.png'; } } + + window.setTimeout(update_status, 5000); } ) + }; - window.setTimeout(arguments.callee, 5000); - })(); + update_status(); ]]></script> <h2><a id="content" name="content"><%:Wireless Overview%></a></h2> diff --git a/modules/admin-full/luasrc/view/admin_network/wifi_status.htm b/modules/admin-full/luasrc/view/admin_network/wifi_status.htm index e81ff06bd..e4ba48277 100644 --- a/modules/admin-full/luasrc/view/admin_network/wifi_status.htm +++ b/modules/admin-full/luasrc/view/admin_network/wifi_status.htm @@ -2,7 +2,7 @@ <script type="text/javascript"><![CDATA[ var iwxhr = new XHR(); - (function() { + var update_status = function() { iwxhr.get('<%=luci.dispatcher.build_url("admin", "network", "wireless_status", self.ifname)%>', null, function(x, iw) { @@ -55,11 +55,13 @@ else if (d) d.innerHTML = '<%:Wireless is disabled or not associated%>'; } + + window.setTimeout(update_status, 5000); } ) + }; - window.setTimeout(arguments.callee, 5000); - })(); + update_status(); ]]></script> <table> |