gluon-status-page: Code clarification and formatting

This commit is contained in:
Igor Scheller 2022-04-11 23:44:55 +02:00
parent 3e0a6a64e3
commit ea7b3163d1
3 changed files with 12 additions and 10 deletions

View File

@ -231,10 +231,10 @@
<table> <table>
<tbody> <tbody>
<% for _, radio in ipairs(radios) do -%> <% for _, radio in ipairs(radios) do -%>
<tr> <tr>
<th><%| radio.name %></th> <th><%| radio.name %></th>
<td><%| translatef('Channel %u', radio.channel) %></td> <td><%| translatef('Channel %u', radio.channel) %></td>
</tr> </tr>
<%- end %> <%- end %>
</tbody> </tbody>
</table> </table>

File diff suppressed because one or more lines are too long

View File

@ -192,8 +192,9 @@
div.style.display = ''; div.style.display = '';
var table = document.getElementById('mesh-vpn-peers'); var table = document.getElementById('mesh-vpn-peers');
while (table.firstElementChild.lastChild) var tbody = table.firstElementChild;
table.firstElementChild.removeChild(table.firstElementChild.lastChild); while (tbody.lastChild)
tbody.removeChild(tbody.lastChild);
var peers = add_group([], data); var peers = add_group([], data);
peers.sort(); peers.sort();
@ -212,7 +213,7 @@
td.textContent = _['not connected']; td.textContent = _['not connected'];
tr.appendChild(td); tr.appendChild(td);
table.firstElementChild.appendChild(tr); tbody.appendChild(tr);
}); });
} }
@ -444,8 +445,9 @@
} }
function Neighbour(iface, addr, color, destroy) { function Neighbour(iface, addr, color, destroy) {
var th = iface.table.firstElementChild.firstElementChild; var tb = iface.table.firstElementChild;
var el = iface.table.firstElementChild.insertRow(); var th = tb.firstElementChild;
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);