Added remote desktop lock UI.

Ylian Saint-Hilaire committed Jan 20, 2021 at 01:08 UTC 62aa5e76cc71c0f448a6cc6cfb97510b3686275d
3 files changed +9 -2
public/images/icon-lock.png
Binary files /dev/null and b/public/images/icon-lock.png differ
public/styles/style.css
+1 -1
@@ -2549,7 +2549,7 @@ a {
2549 -ms-grid-row: 4;
2550 }
2551
2552 -#DeskChatButton, #DeskNotifyButton, #DeskOpenWebButton, #DeskBackgroundButton, #DeskSaveImageButton, #DeskRecordButton, #DeskClipboardInButton, #DeskClipboardOutButton, #DeskRefreshButton {
2552 +#DeskChatButton, #DeskNotifyButton, #DeskOpenWebButton, #DeskBackgroundButton, #DeskSaveImageButton, #DeskRecordButton, #DeskClipboardInButton, #DeskClipboardOutButton, #DeskRefreshButton, #DeskLockButton {
2553 float: right;
2554 margin-top: 1px;
2555 margin-right: 4px;
views/default.handlebars
+8 -1
@@ -619,6 +619,7 @@
619 <input id=DeskToolsButton type=button value=Tools title="Toggle tools view" onkeypress="return false" onkeydown="return false" onclick="toggleDeskTools()" />&nbsp;
620 <span id=DeskChatButton class="deskarea" title="Open chat window to this computer"><img src='images/icon-chat.png' onclick=deviceChat(event) height=16 width=16 style=padding-top:2px /></span>
621 <span id=DeskNotifyButton title="Display a notification on the remote computer"><img src='images/icon-notify.png' onclick=deviceToastFunction() height=16 width=16 style=padding-top:2px /></span>
622 + <span id=DeskLockButton title="Lock the remote computer"><img src='images/icon-lock.png' onclick=deviceLockFunction() height=16 width=16 style=padding-top:2px /></span>
623 <span id=DeskOpenWebButton title="Open a web address on the remote computer"><img src='images/icon-url2.png' onclick=deviceUrlFunction() height=16 width=16 style=padding-top:2px /></span>
624 <span id=DeskBackgroundButton title="Toggle remote desktop background"><img src='images/icon-background.png' onclick=deviceToggleBackground(event) height=16 width=16 style=padding-top:2px /></span>
625 <span id=DeskSaveImageButton title="Save a screenshot of the remote desktop"><img src='images/icon-camera.png' onclick=deskSaveImage() height=16 width=16 style=padding-top:2px /></span>
@@ -6347,6 +6348,11 @@
6348 meshserver.send({ action: 'toast', nodeids: [ currentNode._id ], title: decodeURIComponent('{{{extitle}}}'), msg: Q('d2devToast').value });
6349 }
6350
6351 + function deviceLockFunction() {
6352 + if (xxdialogMode) return;
6353 + if ((desktop != null) && (desktop.contype == 1)) { desktop.sendCtrlMsg('{"action":"lock"}'); } // Lock desktop
6354 + }
6355 +
6356 function showShareDevice() {
6357 if (xxdialogMode) return;
6358 var y = '', x = "Creates a link that allows a guest without an account to remote control this device for a limited time." + '<br /><br />';
@@ -6949,7 +6955,8 @@
6955 QV('DeskRecordButton', (deskState == 3) && (Q('Desk')['toBlob'] != null) && (desktop.m.StartRecording != null));
6956 QV('DeskChatButton', ((rights & 16384) != 0) && (browserfullscreen == false) && (inputAllowed) && (currentNode.agent) && online);
6957 QV('DeskNotifyButton', ((rights & 16384) != 0) && (browserfullscreen == false) && (currentNode.agent) && (currentNode.agent.id < 5) && (inputAllowed) && (currentNode.agent) && online);
6952 -
6958 + //QV('DeskLockButton', ((rights & 16384) != 0) && (browserfullscreen == false) && (currentNode.agent) && (currentNode.agent.id < 5) && (inputAllowed) && (currentNode.agent) && (deskState == 3));
6959 + QV('DeskLockButton', false); // TODO: Work on adding remote desktop lock feature.
6960 QV('DeskToolsButton', (inputAllowed) && (currentNode.agent) && online);
6961 QV('DeskOpenWebButton', (browserfullscreen == false) && (inputAllowed) && (currentNode.agent) && online);
6962 QV('DeskBackgroundButton', (deskState == 3) && (desktop.contype == 1) && (currentNode.agent) && (currentNode.agent.id != 11) && (currentNode.agent.id != 16) && online);