Fix RBAC client action visibility
This commit is contained in:
@@ -206,6 +206,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
function syncClientActionCell(row, client, hasActionsColumn) {
|
||||
if (!row || !row.cells) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasActionsColumn) {
|
||||
if (row.cells.length > 6) {
|
||||
row.deleteCell(row.cells.length - 1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var actionCell = row.cells.length > 6 ? row.cells[6] : null;
|
||||
if (!actionCell) {
|
||||
actionCell = row.insertCell(-1);
|
||||
actionCell.setAttribute('data-label', 'Actions');
|
||||
actionCell.className = 'text-end';
|
||||
}
|
||||
|
||||
updateClientActionCell(actionCell, client);
|
||||
}
|
||||
|
||||
function renderClientRow(client, hasActionsColumn) {
|
||||
var connectedAt = client.connectedAt ? '<div>' + escapeHtml(client.connectedAtLabel || formatDashboardDate(client.connectedAt) || client.connectedAt) + '</div>' + (client.lastSeenAt ? '<div class="subtle">' + escapeHtml(client.lastSeenAtLabel || formatDashboardDate(client.lastSeenAt) || client.lastSeenAt) + '</div>' : '') : '<span class="empty">Unknown</span>';
|
||||
var clientIpValue = normalizeDisplayIp(client.clientIp);
|
||||
@@ -317,9 +339,7 @@
|
||||
row.cells[3].innerHTML = clientIp;
|
||||
row.cells[4].innerHTML = viewport;
|
||||
row.cells[5].innerHTML = connectedAt;
|
||||
if (hasActionsColumn && row.cells.length >= 7) {
|
||||
updateClientActionCell(row.cells[6], client);
|
||||
}
|
||||
syncClientActionCell(row, client, hasActionsColumn);
|
||||
}
|
||||
|
||||
var referenceNode = tbody.children[index] || null;
|
||||
|
||||
Reference in New Issue
Block a user