Skip to content

Commit

Permalink
add RDP to device context menu #6401
Browse files Browse the repository at this point in the history
Signed-off-by: si458 <simonsmith5521@gmail.com>
  • Loading branch information
si458 committed Sep 26, 2024
1 parent 39a1755 commit b90b2ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion translate/translate.json
Original file line number Diff line number Diff line change
Expand Up @@ -61827,7 +61827,8 @@
"default.handlebars->47->1042",
"default.handlebars->47->439",
"default.handlebars->47->998",
"default.handlebars->container->dialog->dialogBody->dialog7->1->td7rdpkvm"
"default.handlebars->container->dialog->dialogBody->dialog7->1->td7rdpkvm",
"default.handlebars->contextMenu->cxrdp"
]
},
{
Expand Down
13 changes: 12 additions & 1 deletion views/default.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<div id="cxwebrdp" class="cmtext" onclick="cmaction(11,event)">Web-RDP</div>
<div id="cxwebvnc" class="cmtext" onclick="cmaction(12,event)">Web-VNC</div>
<div id="cxwebssh" class="cmtext" onclick="cmaction(13,event)">Web-SSH</div>
<div id="cxrdp" class="cmtext" onclick="cmaction(14,event)">RDP</div>
<div id="cxplugins" class="cmtext" onclick="cmaction(8,event)" style="display:none">Plugins</div>
<hr id="cxmgroupsplit" />
<div id="cxstar" class="cmtext" onclick="cmaction(10,event)" style="display:none">Toggle Star</div>
Expand Down Expand Up @@ -6448,7 +6449,16 @@
QV('cxwebrdp', ((((node.conn & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((rights & 8) != 0) && ((features & 0x40000000) == 0)));
QV('cxwebssh', ((features2 & 0x200) && (((node.conn & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((rights & 8) != 0)));
QV('cxconsole', (consoleRights && (node.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 8) != 0))) && (rights & 8));

QV('cxrdp', false); // always have the RDP hidden
if ((((node.conn & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((rights & 8) != 0)) {
if ((node.agent.id > 0) && (node.agent.id < 5)) {
if (navigator.platform.toLowerCase() == 'win32') {
if ((serverinfo.devicemeshrouterlinks == null) || (serverinfo.devicemeshrouterlinks.rdp != false)) {
QV('cxrdp', true);
}
}
}
}
QV('cxmgroupsplit', true);
QV('cxstar', true);
break;
Expand Down Expand Up @@ -6516,6 +6526,7 @@
else if (action == 11) { p10mstsc(nodeid); } // Web-RDP
else if (action == 12) { p10rfb(nodeid); } // Web-VNC
else if (action == 13) { p10ssh(nodeid); } // Web-SSH
else if (action == 14) { p10MCRouter(nodeid,3); } // RDP
}

function cmmeshaction(action) {
Expand Down

0 comments on commit b90b2ac

Please sign in to comment.