Improved guest share list in device group tab.
Ylian Saint-Hilaire committed
Dec 1, 2021 at 15:12 UTC
8a53c15897c8ca7ae31086a41b01e6c42cbba075
1 file changed
+8
-7
views/default.handlebars
+8
-7
@@ -11710,7 +11710,7 @@
11710
11711
// Show device shares
11712
if ((deviceShares != null) && (deviceSharesNode == currentMesh._id) && (deviceShares.length > 0)) {
11713
- 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>';
11713
+ 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>';
11714
count = 1;
11715
for (var i = 0; i < deviceShares.length; i++) {
11716
var dshare = deviceShares[i], trash = '';
@@ -11728,7 +11728,12 @@
11728
}
11729
var guestName = EscapeHtml(dshare.guestName);
11730
if (dshare.publicid.startsWith('AS:node/')) { guestName = '<i>' + "Agent Self-Share" + '</i>'; }
11731
- x += '<tr ' + (((++count % 2) == 0) ? 'style=background-color:#DDD' : '') + '><td style=width:30%><div class=m' + 2 + '></div><div> ' + guestName + '<div></div></div></td><td style=width:70%><div style=float:right>' + trash + '</div><div>' + details + '</div></td></tr>';
11731
+ var node = getNodeFromId(dshare.nodeid);
11732
+ if (node != null) {
11733
+ var gray = ((node.conn > 0)?'':' gray');
11734
+ var computer = '<div onclick=\'gotoDevice("' + node._id + '",10);haltEvent(event);\' style=float:left class="j' + node.icon + gray + '"></div> <a onclick=\'gotoDevice("' + node._id + '",10);haltEvent(event);\'>' + EscapeHtml(node.name) + '</a>';
11735
+ x += '<tr ' + (((++count % 2) == 0) ? 'style=background-color:#DDD' : '') + '><td style=width:30%>' + computer + '<td style=width:30%><div class=m' + 2 + '></div><div> ' + guestName + '<div></div></div></td><td style=width:70%><div style=float:right>' + trash + '</div><div>' + details + '</div></td></tr>';
11736
+ }
11737
}
11738
x += '</tbody></table>';
11739
} else {
@@ -11760,11 +11765,7 @@
11765
11766
// If we are full administrator on this mesh, allow deletion of the mesh
11767
if (meshrights == 0xFFFFFFFF) {
11763
- if (count == 0) {
11764
- x += '<div style=font-size:small;text-align:right><span><a href=# onclick=p20showDeleteMeshDialog() style=cursor:pointer>' + "Delete Group" + '</a></span></div>';
11765
- } else {
11766
- y += '<div style=font-size:small;text-align:right><span><a href=# onclick=p20showDeleteMeshDialog() style=cursor:pointer>' + "Delete Group" + '</a></span></div>';
11767
- }
11768
+ y += '<div style=font-size:small;text-align:right><span><a href=# onclick=p20showDeleteMeshDialog() style=cursor:pointer>' + "Delete Group" + '</a></span></div>';
11769
}
11770
11771
QH('p20info', x);