Improved guest share list in device group tab.

This commit is contained in:
Ylian Saint-Hilaire 2021-12-01 15:12:07 -08:00
parent e199c0c073
commit 8a53c15897

View File

@ -11710,7 +11710,7 @@
// Show device shares // Show device shares
if ((deviceShares != null) && (deviceSharesNode == currentMesh._id) && (deviceShares.length > 0)) { if ((deviceShares != null) && (deviceSharesNode == currentMesh._id) && (deviceShares.length > 0)) {
x += '<p></p><table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>' + "Active Device Sharing" + '</th><th scope=col style=text-align:left></th></tr>'; x += '<p></p><table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>' + "Active Device Sharing" + '</th><th scope=col style=text-align:left><th scope=col style=text-align:left></th></tr>';
count = 1; count = 1;
for (var i = 0; i < deviceShares.length; i++) { for (var i = 0; i < deviceShares.length; i++) {
var dshare = deviceShares[i], trash = ''; var dshare = deviceShares[i], trash = '';
@ -11728,7 +11728,12 @@
} }
var guestName = EscapeHtml(dshare.guestName); var guestName = EscapeHtml(dshare.guestName);
if (dshare.publicid.startsWith('AS:node/')) { guestName = '<i>' + "Agent Self-Share" + '</i>'; } if (dshare.publicid.startsWith('AS:node/')) { guestName = '<i>' + "Agent Self-Share" + '</i>'; }
x += '<tr ' + (((++count % 2) == 0) ? 'style=background-color:#DDD' : '') + '><td style=width:30%><div class=m' + 2 + '></div><div>&nbsp;' + guestName + '<div></div></div></td><td style=width:70%><div style=float:right>' + trash + '</div><div>' + details + '</div></td></tr>'; var node = getNodeFromId(dshare.nodeid);
if (node != null) {
var gray = ((node.conn > 0)?'':' gray');
var computer = '<div onclick=\'gotoDevice("' + node._id + '",10);haltEvent(event);\' style=float:left class="j' + node.icon + gray + '"></div>&nbsp;<a onclick=\'gotoDevice("' + node._id + '",10);haltEvent(event);\'>' + EscapeHtml(node.name) + '</a>';
x += '<tr ' + (((++count % 2) == 0) ? 'style=background-color:#DDD' : '') + '><td style=width:30%>' + computer + '<td style=width:30%><div class=m' + 2 + '></div><div>&nbsp;' + guestName + '<div></div></div></td><td style=width:70%><div style=float:right>' + trash + '</div><div>' + details + '</div></td></tr>';
}
} }
x += '</tbody></table>'; x += '</tbody></table>';
} else { } else {
@ -11760,11 +11765,7 @@
// If we are full administrator on this mesh, allow deletion of the mesh // If we are full administrator on this mesh, allow deletion of the mesh
if (meshrights == 0xFFFFFFFF) { if (meshrights == 0xFFFFFFFF) {
if (count == 0) { y += '<div style=font-size:small;text-align:right><span><a href=# onclick=p20showDeleteMeshDialog() style=cursor:pointer>' + "Delete Group" + '</a></span></div>';
x += '<div style=font-size:small;text-align:right><span><a href=# onclick=p20showDeleteMeshDialog() style=cursor:pointer>' + "Delete Group" + '</a></span></div>';
} else {
y += '<div style=font-size:small;text-align:right><span><a href=# onclick=p20showDeleteMeshDialog() style=cursor:pointer>' + "Delete Group" + '</a></span></div>';
}
} }
QH('p20info', x); QH('p20info', x);