Added device web ssh/rdp/vnc context menus, #3544
Ylian Saint-Hilaire committed
Jan 26, 2022 at 23:32 UTC
7f5e158fd821effa8412aa6c69f6fe19c85b207b
1 file changed
+13
-3
views/default.handlebars
+13
-3
@@ -50,6 +50,9 @@
50
<div id="cxevents" class="cmtext" onclick="cmaction(5,event)">Events</div>
51
<div id="cxdetails" class="cmtext" onclick="cmaction(6,event)">Details</div>
52
<div id="cxconsole" class="cmtext" onclick="cmaction(7,event)">Console</div>
53
+ <div id="cxwebrdp" class="cmtext" onclick="cmaction(11,event)">Web-RDP</div>
54
+ <div id="cxwebvnc" class="cmtext" onclick="cmaction(12,event)">Web-VNC</div>
55
+ <div id="cxwebssh" class="cmtext" onclick="cmaction(13,event)">Web-SSH</div>
56
<div id="cxplugins" class="cmtext" onclick="cmaction(8,event)" style="display:none">Plugins</div>
57
<hr id="cxmgroupsplit" />
58
<div id="cxstar" class="cmtext" onclick="cmaction(10,event)" style="display:none">Toggle Star</div>
@@ -5749,12 +5752,16 @@
5752
var terminalAccess = ((rights == 0xFFFFFFFF) || ((rights & 512) == 0));
5753
var fileAccess = ((rights == 0xFFFFFFFF) || ((rights & 1024) == 0));
5754
5752
- QV('cxdesktop', (node.mtype != 4) && ((node.mtype == 1) || (node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 1) != 0) || (node.intelamt && (node.intelamt.state == 2))) && ((rights & 8) || (rights & 256)) && desktopAccess);
5753
- QV('cxterminal', (node.mtype != 4) && ((node.mtype == 1) || (node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 2) != 0) || (node.intelamt && (node.intelamt.state == 2))) && (rights & 8) && terminalAccess);
5755
+ QV('cxdesktop', ((node.conn & 1) != 0) && (node.mtype != 4) && ((node.mtype == 1) || (node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 1) != 0) || (node.intelamt && (node.intelamt.state == 2))) && ((rights & 8) || (rights & 256)) && desktopAccess);
5756
+ QV('cxterminal', ((node.conn & 1) != 0) && (node.mtype != 4) && ((node.mtype == 1) || (node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 2) != 0) || (node.intelamt && (node.intelamt.state == 2))) && (rights & 8) && terminalAccess);
5757
QV('cxfiles', (node.mtype != 4) && ((node.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 4) != 0))) && (rights & 8) && fileAccess);
5758
QV('cxevents', (node.intelamt != null) && ((node.intelamt.state == 2) || (node.conn & 2)) && (rights & 8));
5759
QV('cxdetails', node.mtype < 3);
5760
+ QV('cxwebrdp', ((((node.conn & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((rights & 8) != 0) && ((features & 0x20000000) == 0)));
5761
+ QV('cxwebvnc', ((((node.conn & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((rights & 8) != 0) && ((features & 0x40000000) == 0)));
5762
+ QV('cxwebssh', ((features2 & 0x200) && (((node.conn & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((rights & 8) != 0)));
5763
QV('cxconsole', (consoleRights && (node.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 8) != 0))) && (rights & 8));
5764
+
5765
QV('cxmgroupsplit', true);
5766
QV('cxstar', true);
5767
break;
@@ -5780,7 +5787,7 @@
5787
element.style.display = 'block';
5788
}
5789
5783
- function cmaction(action,event) {
5790
+ function cmaction(action, event) {
5791
var nodeid;
5792
if (Q('viewselect').value == 1) {
5793
nodeid = contextelement.children[0].children[0].children[1].children[0].attributes.onclick.value;
@@ -5819,6 +5826,9 @@
5826
updateDeviceViewDevice(nodeid);
5827
if (Q('DevFilterSelect').value == 3) { mainUpdate(1); }
5828
}
5829
+ else if (action == 11) { p10mstsc(nodeid); } // Web-RDP
5830
+ else if (action == 12) { p10rfb(nodeid); } // Web-VNC
5831
+ else if (action == 13) { p10ssh(nodeid); } // Web-SSH
5832
}
5833
5834
function cmmeshaction(action) {