modules/admin-full: various javascript fixes in templates
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Sep 2011 20:51:03 +0000 (20:51 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 25 Sep 2011 20:51:03 +0000 (20:51 +0000)
modules/admin-full/luasrc/view/admin_network/iface_status.htm
modules/admin-full/luasrc/view/admin_status/index.htm

index 508ccbb92820b6398b815051de545288c60554a2..69ae0527239bf7836567b9a982a030f5cd2d4aa8 100644 (file)
@@ -19,7 +19,7 @@
                                                        '<img src="<%=resource%>/icons/%s%s.png" style="width:16px; height:16px" />' +
                                                        '<br /><small>%s</small>',
                                                                ifc.type, ifc.is_up ? '' : '_disabled',
-                                                               ifc.name
+                                                               ifc.is_up ? ifc.ifname : '?'
                                                );
 
                                        var d = document.getElementById('<%=self.option%>-ifc-description');
index 850c30ab1984f655bdba55bbd2d457688f91c62b..f76511e0a5739d08fcef3828652dd9a76d6aee01 100644 (file)
@@ -123,7 +123,9 @@ $Id$
        var wifidevs = <%=luci.http.write_json(netdevs)%>;
        var arptable = <%=luci.http.write_json(arpcache)%>;
 
-       var update_status = function() {
+       (function() {
+               var func = arguments.callee;
+
                iwxhr.get('<%=REQUEST_URI%>', { status: 1 },
                        function(x, info)
                        {
@@ -457,12 +459,10 @@ $Id$
                                if (e = document.getElementById('conns'))
                                        e.innerHTML = progressbar(info.conncount, info.connmax);
 
-                               window.setTimeout(update_status, 5000);
+                               window.setTimeout(func, 5000);
                        }
                )
-       };
-
-       update_status();
+       })();
 //]]></script>
 
 <h2><a id="content" name="content"><%:Status%></a></h2>