1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

More ui fixes, Windows agent toast fix

This commit is contained in:
Ylian Saint-Hilaire 2018-09-19 10:37:19 -07:00
parent fc423c83da
commit 3d14cf220d
12 changed files with 183 additions and 17 deletions

View file

@ -30,10 +30,10 @@
</head>
<body id="body" onload="if (typeof(startup) !== 'undefined') startup();" oncontextmenu="handleContextMenu(event)" style="display:none">
<!-- right click menu -->
<div id="contextMenu" class="contextMenu" style="display: none">
<div id="contextMenu" class="contextMenu" style="display:none">
<div id="cxinfo" class="cmtext" onclick="cmaction(1)"><b>Information</b></div>
<div id="cxterminal" class="cmtext" onclick="cmaction(2)">Terminal</div>
<div id="cxdesktop" class="cmtext" onclick="cmaction(3)">Desktop</div>
<div id="cxterminal" class="cmtext" onclick="cmaction(2)">Terminal</div>
<div id="cxfiles" class="cmtext" onclick="cmaction(4)">Files</div>
<div id="cxevents" class="cmtext" onclick="cmaction(5)">Events</div>
<div id="cxconsole" class="cmtext" onclick="cmaction(6)">Console</div>
@ -151,7 +151,7 @@
</div><div><h1>My Devices</h1></div>
<div style=width:100%;height:24px;background-color:#d3d9d6>
<div class=h1 style=height:100%;float:left>&nbsp;</div>
<div id=devListToolbar class=style14 style=height:100%;float:left>
<div id=devListToolbar class=style14 style="height:100%;float:left;vertical-align:middle">
&nbsp;&nbsp;<input type="button" id="SelectAllButton" onclick="selectallButtonFunction();" value="Select All" />&nbsp;
<input type=button id=GroupActionButton disabled="disabled" value="Group Action" onclick=groupActionFunction() />&nbsp;
<input id=SearchInput type=text style=width:120px placeholder=Search onchange=onSearchInputChanged() onkeyup=onSearchInputChanged() autocomplete=off onfocus=onSearchFocus(1) onblur=onSearchFocus(0) />&nbsp;
@ -2299,6 +2299,20 @@
contextmenudiv.style.top = event.pageY + "px";
contextmenudiv.style.display = "block";
}
// Get the node and set the menu options
var nodeid = contextelement.children[1].attributes.onclick.value;
var node = getNodeFromId(nodeid.substring(12, nodeid.length - 2));
var mesh = meshes[node.meshid];
var meshlinks = mesh.links['user/' + domain + '/' + userinfo.name.toLowerCase()];
var meshrights = meshlinks.rights;
var consoleRights = ((meshrights & 16) != 0);
QV('cxdesktop', ((mesh.mtype == 1) || (node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 1) != 0) || (node.intelamt && (node.intelamt.state == 2))) && (meshrights & 8));
QV('cxterminal', ((mesh.mtype == 1) || (node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 2) != 0) || (node.intelamt && (node.intelamt.state == 2))) && (meshrights & 8));
QV('cxfiles', ((mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 4) != 0))) && (meshrights & 8));
QV('cxevents', (node.intelamt != null) && ((node.intelamt.state == 2) || (node.conn & 2)) && (meshrights & 8));
QV('cxconsole', (consoleRights && (mesh.mtype == 2) && ((node.agent == null) || (node.agent.caps == null) || ((node.agent.caps & 8) != 0))) && (meshrights & 8));
return haltEvent(event);
}
@ -2964,7 +2978,7 @@
// Add node name
var nname = EscapeHtml(node.name);
if (nname.length == 0) { nname = '<i>None</i>'; }
if ((meshrights & 4) != 0) { nname = '<span title="Click here to edit the server-side device name" onclick=showEditNodeValueDialog(0) style=cursor:pointer>' + nname + ' <img src="images/link5.png" /></span>'; }
if ((meshrights & 4) != 0) { nname = '<span title="Click here to edit the server-side device name" onclick=showEditNodeValueDialog(0) style=cursor:pointer>' + nname + ' <img class=hoverButton src="images/link5.png" /></span>'; }
QH('p10deviceName', nname);
QH('p11deviceName', nname);
QH('p12deviceName', nname);
@ -2998,7 +3012,7 @@
// Attribute: Description
var description = node.desc?EscapeHtml(node.desc):"<i>None</i>";
if ((meshrights & 4) != 0) {
x += addDeviceAttribute('Description', '<span onclick=showEditNodeValueDialog(2) style=cursor:pointer>' + description + '</span>');
x += addDeviceAttribute('Description', '<span onclick=showEditNodeValueDialog(2) style=cursor:pointer>' + description + ' <img class=hoverButton src="images/link5.png" /></span>');
} else {
x += addDeviceAttribute('Description', description);
}
@ -3067,7 +3081,7 @@
// Node grouping tags
var groupingTags = '<i>None</i>';
if (node.tags != null) { groupingTags = ''; for (var i in node.tags) { groupingTags += '<span style="background-color:lightgray;padding:3px;margin-right:4px;border-radius:5px">' + node.tags[i] + '</span>'; } }
x += addDeviceAttribute('Groups', '<span onclick=showEditNodeValueDialog(3) style=cursor:pointer>' + groupingTags + '</span>');
x += addDeviceAttribute('Groups', '<span onclick=showEditNodeValueDialog(3) style=cursor:pointer>' + groupingTags + ' <img class=hoverButton src="images/link5.png" /></span>');
x += '</table><br />';
// Show action button, only show if we have permissions 4, 8, 64