add RDP to device context menu #6401

Signed-off-by: si458 <simonsmith5521@gmail.com>

si458 committed Sep 26, 2024 at 19:51 UTC b90b2ac0bf5ea45ca145e663f4b449d6c47e095c
2 files changed +14 -2
translate/translate.json
+2 -1
@@ -61827,7 +61827,8 @@
61827 "default.handlebars->47->1042",
61828 "default.handlebars->47->439",
61829 "default.handlebars->47->998",
61830 - "default.handlebars->container->dialog->dialogBody->dialog7->1->td7rdpkvm"
61830 + "default.handlebars->container->dialog->dialogBody->dialog7->1->td7rdpkvm",
61831 + "default.handlebars->contextMenu->cxrdp"
61832 ]
61833 },
61834 {
views/default.handlebars
+12 -1
@@ -64,6 +64,7 @@
64 <div id="cxwebrdp" class="cmtext" onclick="cmaction(11,event)">Web-RDP</div>
65 <div id="cxwebvnc" class="cmtext" onclick="cmaction(12,event)">Web-VNC</div>
66 <div id="cxwebssh" class="cmtext" onclick="cmaction(13,event)">Web-SSH</div>
67 + <div id="cxrdp" class="cmtext" onclick="cmaction(14,event)">RDP</div>
68 <div id="cxplugins" class="cmtext" onclick="cmaction(8,event)" style="display:none">Plugins</div>
69 <hr id="cxmgroupsplit" />
70 <div id="cxstar" class="cmtext" onclick="cmaction(10,event)" style="display:none">Toggle Star</div>
@@ -6448,7 +6449,16 @@
6449 QV('cxwebrdp', ((((node.conn & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((rights & 8) != 0) && ((features & 0x40000000) == 0)));
6450 QV('cxwebssh', ((features2 & 0x200) && (((node.conn & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((rights & 8) != 0)));
6451 QV('cxconsole', (consoleRights && (node.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 8) != 0))) && (rights & 8));
6451 -
6452 + QV('cxrdp', false); // always have the RDP hidden
6453 + if ((((node.conn & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((rights & 8) != 0)) {
6454 + if ((node.agent.id > 0) && (node.agent.id < 5)) {
6455 + if (navigator.platform.toLowerCase() == 'win32') {
6456 + if ((serverinfo.devicemeshrouterlinks == null) || (serverinfo.devicemeshrouterlinks.rdp != false)) {
6457 + QV('cxrdp', true);
6458 + }
6459 + }
6460 + }
6461 + }
6462 QV('cxmgroupsplit', true);
6463 QV('cxstar', true);
6464 break;
@@ -6516,6 +6526,7 @@
6526 else if (action == 11) { p10mstsc(nodeid); } // Web-RDP
6527 else if (action == 12) { p10rfb(nodeid); } // Web-VNC
6528 else if (action == 13) { p10ssh(nodeid); } // Web-SSH
6529 + else if (action == 14) { p10MCRouter(nodeid,3); } // RDP
6530 }
6531
6532 function cmmeshaction(action) {