gluon-status-page: Move mesh vpn id to table body, directly use table body

This commit is contained in:
Igor Scheller 2022-04-17 23:08:31 +02:00
parent ea7b3163d1
commit 68a5a74d1d
3 changed files with 7 additions and 9 deletions

View File

@ -251,8 +251,8 @@
<div id="mesh-vpn" style="display: none"> <div id="mesh-vpn" style="display: none">
<h3><%:Mesh VPN%></h3> <h3><%:Mesh VPN%></h3>
<table id="mesh-vpn-peers"> <table>
<tbody></tbody> <tbody id="mesh-vpn-peers"></tbody>
</table> </table>
</div> </div>
</div> </div>

File diff suppressed because one or more lines are too long

View File

@ -191,8 +191,7 @@
} }
div.style.display = ''; div.style.display = '';
var table = document.getElementById('mesh-vpn-peers'); var tbody = document.getElementById('mesh-vpn-peers');
var tbody = table.firstElementChild;
while (tbody.lastChild) while (tbody.lastChild)
tbody.removeChild(tbody.lastChild); tbody.removeChild(tbody.lastChild);
@ -445,9 +444,8 @@
} }
function Neighbour(iface, addr, color, destroy) { function Neighbour(iface, addr, color, destroy) {
var tb = iface.table.firstElementChild; var th = iface.tbody.firstElementChild;
var th = tb.firstElementChild; var el = iface.tbody.insertRow();
var el = tb.insertRow();
var tdHostname = el.insertCell(); var tdHostname = el.insertCell();
tdHostname.setAttribute('data-label', th.children[0].textContent); tdHostname.setAttribute('data-label', th.children[0].textContent);
@ -694,7 +692,7 @@
} }
var info = { var info = {
'table': el.firstElementChild, 'tbody': el.firstElementChild.firstElementChild,
'signalgraph': signalgraph, 'signalgraph': signalgraph,
'ifname': ifname, 'ifname': ifname,
'wireless': wireless, 'wireless': wireless,