modules/admin-full: various javascript fixes in templates
[project/luci.git] / modules / admin-full / luasrc / view / admin_status / index.htm
index 3e73eb1..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'
                                        );
 
@@ -310,7 +312,7 @@ $Id$
 
                                                        s += String.format(
                                                                '<table><tr><td style="text-align:center; width:32px; padding:3px">' +
-                                                                       '<img src="%s" title="<%:Signal%>: %d dBm / Noise: <%:Noise%>: %d dBm" />' +
+                                                                       '<img src="%s" title="<%:Signal%>: %d dBm / <%:Noise%>: %d dBm" />' +
                                                                        '<br /><small>%d%%</small>' +
                                                                '</td><td style="text-align:left; padding:3px"><small>' +
                                                                        '<strong><%:SSID%>:</strong> <a href="%s">%h</a><br />' +
@@ -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>
 
@@ -549,7 +549,7 @@ $Id$
 
        <table class="cbi-section-table" id="wifi_assoc_table">
                <tr class="cbi-section-table-titles">
-                       <th class="cbi-section-table-cell">&nbsp;</th>
+                       <th class="cbi-section-table-cell">&#160;</th>
                        <th class="cbi-section-table-cell"><%:BSSID%></th>
                        <th class="cbi-section-table-cell"><%:Network%></th>
                        <th class="cbi-section-table-cell"><%:Signal%></th>
@@ -562,4 +562,19 @@ $Id$
 </fieldset>
 <% end %>
 
+<%-
+       require "luci.util"
+       require "nixio.fs"
+
+       local plugins = nixio.fs.dir(luci.util.libpath() .. "/view/admin_status/index")
+       if plugins then
+               local inc
+               for inc in plugins do
+                       if inc:match("%.htm$") then
+                               include("admin_status/index/" .. inc:gsub("%.htm$", ""))
+                       end
+               end
+       end
+-%>
+
 <%+footer%>