modules/admin-full: xhr fixes
[project/luci.git] / modules / admin-full / luasrc / view / admin_network / lease_status.htm
index 9555d14..1d7c916 100644 (file)
@@ -1,12 +1,10 @@
 <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)
+                       function(x, st)
                        {
-                               var st = x.responseText ? eval('(' + x.responseText + ')') : null;
                                var tb = document.getElementById('lease_status_table');
-
                                if (st && tb)
                                {
                                        /* clear all rows */
                                        {
                                                var tr = document.createElement('tr');
                                                        tr.className = 'cbi-section-table-row';
-                                                       tr.innerHTML = '<td colspan="5"><em><br /><%:There are no active leases.%></em></td>';
+                                                       tr.innerHTML = '<td colspan="4"><em><br /><%:There are no active leases.%></em></td>';
 
                                                tb.rows[0].parentNode.appendChild(tr);
                                        }
                                }
+
+                               window.setTimeout(update_status, 5000);
                        }
                )
+       };
 
-               window.setTimeout(arguments.callee, 5000);
-       })();
+       update_status();
 ]]></script>
 
 <fieldset class="cbi-section">
@@ -91,7 +91,7 @@
                        <th class="cbi-section-table-cell"><%:Leasetime remaining%></th>
                </tr>
                <tr class="cbi-section-table-row">
-                       <td colspan="5"><em><br /><%:Collecting data...%></em></td>
+                       <td colspan="4"><em><br /><%:Collecting data...%></em></td>
                </tr>
        </table>
 </fieldset>