From b54d0130f751d1489afa9d8546e0c90665dc9c06 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Fri, 19 Aug 2022 13:19:50 -0700 Subject: [PATCH] Added run script run button to desktop tab and run dialog now saves state. --- public/images/icon-play.png | Bin 0 -> 570 bytes public/styles/style.css | 2 +- views/default.handlebars | 23 +++++++++++++++-------- 3 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 public/images/icon-play.png diff --git a/public/images/icon-play.png b/public/images/icon-play.png new file mode 100644 index 0000000000000000000000000000000000000000..3459b926057a088631614ec642321e323a4a704b GIT binary patch literal 570 zcmV-A0>%A_P)4Tx04UFukxM8pSQBI_EnOILMloTiFGcop<6R zF>N|IqlKQSAw(l#T6NRSjZY3IC_6rGsZi@pRAuqMQI}e9O{ma>2h5z47oHdHTg~Sb z?+8cCMLi{aD%|PF1%>aGZWQ=MamMF>%8WRP_@Hn^Sj&{KQNre;V+r>Px1}sw@&nTa zPAOhfY-Lx>pL?no)-KpnlS-G_!U&^`Gl7P|3QJ_k6P48##U(ELu`>Q<-#;NPLtIOk z;uvBX3*Gml{@{1FZn~$tkW?FkswdBTYlqMld~JH(=b`6)9YOFBF6^Rz`2hOgMc*uH zZTnEa4riA|&De(X4QP7E>5lG8L79Pc8eUK2o08CQ4dK~BZ$JAS-$6pU8oPqsJ?O|t z_FS2FSC{to=NZ30V&7pVa-dG`V_5(I010qNS#tmY4#WTe4#WYKD-Ig~003S|L_t(I zPqouK3cxT71W_sXzq6bH6ENtrA!Hi6*;m;f5%#5PpGWR4t0_P#QUatPEkF}80@NWA zKoueblp(Kx`_1^iKFL5fCJCsh2T3{Me2`FRw=Qrw^E%4|c8y#W~QUCw|07*qo IM6N<$f(*O*j{pDw literal 0 HcmV?d00001 diff --git a/public/styles/style.css b/public/styles/style.css index cadde009..9edfe95a 100644 --- a/public/styles/style.css +++ b/public/styles/style.css @@ -2654,7 +2654,7 @@ a { -ms-grid-row: 4; } -#DeskChatButton, #DeskNotifyButton, #DeskOpenWebButton, #DeskBackgroundButton, #DeskSaveImageButton, #DeskRecordButton, #DeskClipboardInButton, #DeskClipboardOutButton, #DeskRefreshButton, #DeskLockButton, #DeskInputLockedButton, #DeskInputUnLockedButton, #DeskGuestShareButton, #DeskMonitorSelectionSpan { +#DeskRunButton, #DeskChatButton, #DeskNotifyButton, #DeskOpenWebButton, #DeskBackgroundButton, #DeskSaveImageButton, #DeskRecordButton, #DeskClipboardInButton, #DeskClipboardOutButton, #DeskRefreshButton, #DeskLockButton, #DeskInputLockedButton, #DeskInputUnLockedButton, #DeskGuestShareButton, #DeskMonitorSelectionSpan { float: right; margin-top: 1px; margin-right: 4px; diff --git a/views/default.handlebars b/views/default.handlebars index 70856a05..9398a0e8 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -703,6 +703,7 @@   + @@ -5717,17 +5718,21 @@ if (n.agent) { if ((GetNodeRights(n) & 24) == 24) { agenttype = true; } if ((n.agent.id > 0) && (n.agent.id < 5)) { wintype = true; } else { linuxtype = true; } } } if ((wintype == true) || (linuxtype == true) || (agenttype == true)) { + // Fetch run options + var runopt = { type:1, runAs:0, source:1, cmd:'' }; + try { runopt = JSON.parse(getstore('runopt', runopt)); } catch (ex) {} + var x = ''; if (options.title) { x += options.title + '
'; } x += ''; - x += ''; - x += ''; + x += ''; + x += ''; x += ''; x += ''; setDialogMode(2, "Run Commands", 3, d2groupActionFunctionRunCommands, x, options); @@ -5749,6 +5754,7 @@ function d2groupActionFunctionRunCommands(b, options) { var type = 3; try { type = parseInt(Q('d2cmdtype').value); } catch (ex) { } + putstore('runopt', JSON.stringify({ type: type, runAs: parseInt(Q('d2cmduser').value), source: parseInt(Q('d2cmdsource').value), cmd: encodeURIComponent(Q('d2runcmd').value) })); // Save run options var cmd = { action: 'runcommands', nodeids: options.nodeids, type: type, runAsUser: parseInt(Q('d2cmduser').value) }; if (Q('d2cmdsource').value == 0) { // From text box @@ -7668,7 +7674,7 @@ } // Run commands on current device - function runDeviceCmd(nodeid) { if (xxdialogMode) return; d2runCommandDialog({ nodeids: [ decodeURIComponent(nodeid) ] }); } + function runDeviceCmd(nodeid) { if (xxdialogMode) return; d2runCommandDialog({ nodeids: [ decodeURIComponent(nodeid ? nodeid : currentNode._id) ] }); } function writeDeviceEvent(nodeid) { if (xxdialogMode) return; @@ -8602,6 +8608,7 @@ } // Display this only if we have Chat & Notify permissions + QV('DeskRunButton', ((rights & 131072) != 0) && online); QV('DeskSaveImageButton', (deskState == 3) && (Q('Desk')['toBlob'] != null) && ((features2 & 0x400) == 0)); QV('DeskRecordButton', (deskState == 3) && (Q('Desk')['toBlob'] != null) && (desktop.m.StartRecording != null) && ((features2 & 0x400) == 0)); QV('DeskChatButton', ((rights & 16384) != 0) && (browserfullscreen == false) && (inputAllowed) && (currentNode.agent) && online);