modules/admin-full: various javascript fixes in templates
[project/luci.git] / modules / admin-full / luasrc / view / admin_status / index.htm
index f6432ef..f76511e 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)
                        {
@@ -140,7 +142,7 @@ $Id$
                                                '<strong><%:Gateway%>: </strong>%s<br />',
                                                        ifc.proto,
                                                        (ifc.ipaddr) ? ifc.ipaddr : '0.0.0.0',
-                                                       (ifc.netmask != ifc.ipaddr) ? ifc.netmask : '255.255.255.255',
+                                                       (ifc.netmask && ifc.netmask != ifc.ipaddr) ? ifc.netmask : '255.255.255.255',
                                                        (ifc.gwaddr) ? ifc.gwaddr : '0.0.0.0'
                                        );
 
@@ -409,7 +411,7 @@ $Id$
                                                tr.insertCell(-1).innerHTML = String.format('%d dBm', assoclist[i].noise);
                                        }
 
-                                       if (ac.rows.length == 0)
+                                       if (ac.rows.length == 1)
                                        {
                                                var tr = ac.rows[0].parentNode.insertRow(-1);
                                                    tr.className = 'cbi-section-table-row';
@@ -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>
@@ -475,7 +475,7 @@ $Id$
                <tr><td width="33%"><%:Router Model%></td><td><%=pcdata(model or "?")%></td></tr>
                <tr><td width="33%"><%:Firmware Version%></td><td>
                        <%=pcdata(luci.version.distname)%> <%=pcdata(luci.version.distversion)%> /
-                       <%=pcdata(luci.version.luciname)%> <%=pcdata(luci.version.luciversion)%>
+                       <%=pcdata(luci.version.luciname)%> (<%=pcdata(luci.version.luciversion)%>)
                </td></tr>
                <tr><td width="33%"><%:Kernel Version%></td><td><%=luci.sys.exec("uname -r")%></td></tr>
                <tr><td width="33%"><%:Local Time%></td><td id="localtime">-</td></tr>
@@ -513,7 +513,7 @@ $Id$
                        </tr></table>
                </td></tr>
                <% end %>
-               <tr><td width="33%"><%:Active IP Connections%></td><td id="conns">-</td></tr>
+               <tr><td width="33%"><%:Active Connections%></td><td id="conns">-</td></tr>
        </table>
 </fieldset>