Merge pull request #2457 from MyIgel/statuspage-fix-tables
gluon-status-page: explicitly add tbody element to fix table manipulation
This commit is contained in:
commit
1992383134
@ -209,41 +209,50 @@
|
||||
<div class="frame">
|
||||
<h2><%:Monitoring%></h2>
|
||||
<table>
|
||||
<tr><th><%:Uptime%></th><td><%= statistics('uptime', 'time') %></td></tr>
|
||||
<tr><th><%:Load average%></th><td><%= statistics('loadavg', 'decimal') %></td></tr>
|
||||
<tr><th><%:RAM%></th><td><%= statistics('memory', 'memory') %></td></tr>
|
||||
<tr><th><%:Filesystem%></th><td><%= statistics('rootfs_usage', 'percent') %></td></tr>
|
||||
<tr><th><%:Gateway%></th><td><%= statistics('gateway') %><br><%= statistics('gateway_nexthop', 'neighbour') %></td></tr>
|
||||
<tbody>
|
||||
<tr><th><%:Uptime%></th><td><%= statistics('uptime', 'time') %></td></tr>
|
||||
<tr><th><%:Load average%></th><td><%= statistics('loadavg', 'decimal') %></td></tr>
|
||||
<tr><th><%:RAM%></th><td><%= statistics('memory', 'memory') %></td></tr>
|
||||
<tr><th><%:Filesystem%></th><td><%= statistics('rootfs_usage', 'percent') %></td></tr>
|
||||
<tr><th><%:Gateway%></th><td><%= statistics('gateway') %><br><%= statistics('gateway_nexthop', 'neighbour') %></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3><%:Clients%></h3>
|
||||
<table>
|
||||
<tr><th><%:Total%></th><td><%= statistics('clients/total') %></td></tr>
|
||||
<tr><th><%:Wireless 2.4 GHz%></th><td><%= statistics('clients/wifi24') %></td></tr>
|
||||
<tr><th><%:Wireless 5 GHz%></th><td><%= statistics('clients/wifi5') %></td></tr>
|
||||
<tbody>
|
||||
<tr><th><%:Total%></th><td><%= statistics('clients/total') %></td></tr>
|
||||
<tr><th><%:Wireless 2.4 GHz%></th><td><%= statistics('clients/wifi24') %></td></tr>
|
||||
<tr><th><%:Wireless 5 GHz%></th><td><%= statistics('clients/wifi5') %></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<% if radios[1] then -%>
|
||||
<h3><%:Radios%></h3>
|
||||
<table>
|
||||
<% for _, radio in ipairs(radios) do -%>
|
||||
<tr>
|
||||
<th><%| radio.name %></th>
|
||||
<td><%| translatef('Channel %u', radio.channel) %></td>
|
||||
</tr>
|
||||
<%- end %>
|
||||
<tbody>
|
||||
<% for _, radio in ipairs(radios) do -%>
|
||||
<tr>
|
||||
<th><%| radio.name %></th>
|
||||
<td><%| translatef('Channel %u', radio.channel) %></td>
|
||||
</tr>
|
||||
<%- end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%- end %>
|
||||
|
||||
<h3><%:Traffic%></h3>
|
||||
<table>
|
||||
<tr><th><%:Transmitted%></th><td><%= statisticsTraffic('traffic/tx') %></td></tr>
|
||||
<tr><th><%:Received%></th><td><%= statisticsTraffic('traffic/rx') %></td></tr>
|
||||
<tr><th><%:Forwarded%></th><td><%= statisticsTraffic('traffic/forward') %></td></tr>
|
||||
<tbody>
|
||||
<tr><th><%:Transmitted%></th><td><%= statisticsTraffic('traffic/tx') %></td></tr>
|
||||
<tr><th><%:Received%></th><td><%= statisticsTraffic('traffic/rx') %></td></tr>
|
||||
<tr><th><%:Forwarded%></th><td><%= statisticsTraffic('traffic/forward') %></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="mesh-vpn" style="display: none">
|
||||
<h3><%:Mesh VPN%></h3>
|
||||
<table id="mesh-vpn-peers">
|
||||
<table>
|
||||
<tbody id="mesh-vpn-peers"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@ -259,17 +268,19 @@
|
||||
<h3><%| iface %></h3>
|
||||
<div data-interface="<%| iface %>" data-interface-address="<%| util.trim(address) %>"<%= attr('data-interface-wireless', wireless) %>>
|
||||
<table class="datatable">
|
||||
<tr>
|
||||
<th><%:Node%></th>
|
||||
<% for i, v in ipairs(mesh.attrs or {}) do %>
|
||||
<th<%= attr('class', 'row-' .. v[1] ) .. attr('data-key', v[1]) .. attr('data-suffix', v[3]) %>><%| v[2] %></th>
|
||||
<% end %>
|
||||
<% if wireless then %>
|
||||
<th class="row-signal">dBm</th>
|
||||
<th class="row-distance"><%:Distance%></th>
|
||||
<th class="row-inactive"><%:Last seen%></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><%:Node%></th>
|
||||
<% for i, v in ipairs(mesh.attrs or {}) do %>
|
||||
<th<%= attr('class', 'row-' .. v[1] ) .. attr('data-key', v[1]) .. attr('data-suffix', v[3]) %>><%| v[2] %></th>
|
||||
<% end %>
|
||||
<% if wireless then %>
|
||||
<th class="row-signal">dBm</th>
|
||||
<th class="row-distance"><%:Distance%></th>
|
||||
<th class="row-inactive"><%:Last seen%></th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<%
|
||||
|
File diff suppressed because one or more lines are too long
@ -191,9 +191,9 @@
|
||||
}
|
||||
|
||||
div.style.display = '';
|
||||
var table = document.getElementById('mesh-vpn-peers');
|
||||
while (table.lastChild)
|
||||
table.removeChild(table.lastChild);
|
||||
var tbody = document.getElementById('mesh-vpn-peers');
|
||||
while (tbody.lastChild)
|
||||
tbody.removeChild(tbody.lastChild);
|
||||
|
||||
var peers = add_group([], data);
|
||||
peers.sort();
|
||||
@ -212,7 +212,7 @@
|
||||
td.textContent = _['not connected'];
|
||||
tr.appendChild(td);
|
||||
|
||||
table.appendChild(tr);
|
||||
tbody.appendChild(tr);
|
||||
});
|
||||
}
|
||||
|
||||
@ -444,8 +444,8 @@
|
||||
}
|
||||
|
||||
function Neighbour(iface, addr, color, destroy) {
|
||||
var th = iface.table.firstElementChild;
|
||||
var el = iface.table.insertRow();
|
||||
var th = iface.tbody.querySelector('tr');
|
||||
var el = iface.tbody.insertRow();
|
||||
|
||||
var tdHostname = el.insertCell();
|
||||
tdHostname.setAttribute('data-label', th.children[0].textContent);
|
||||
@ -692,7 +692,7 @@
|
||||
}
|
||||
|
||||
var info = {
|
||||
'table': el.firstElementChild,
|
||||
'tbody': el.querySelector('tbody'),
|
||||
'signalgraph': signalgraph,
|
||||
'ifname': ifname,
|
||||
'wireless': wireless,
|
||||
|
Loading…
Reference in New Issue
Block a user