mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Added xterm terminal and fixed device link.
This commit is contained in:
parent
b6ff01775f
commit
2f37cd882e
10 changed files with 1444 additions and 990 deletions
|
@ -1770,6 +1770,7 @@
|
|||
|
||||
if (xxcurrentView == -1) { if ('{{viewmode}}' != '') { go(parseInt('{{viewmode}}')); } else { setDialogMode(0); go(1); } }
|
||||
if ('{{currentNode}}' != '') { gotoDevice('{{currentNode}}',parseInt('{{viewmode}}'));}
|
||||
else if (args.gotonode != null) { goBackStack.push(1); gotoDevice('node/' + domain + '/' + args.gotonode,parseInt('{{viewmode}}')); delete args.gotonode; }
|
||||
break;
|
||||
}
|
||||
case 'powertimeline': {
|
||||
|
@ -4785,6 +4786,11 @@
|
|||
// Show node last 7 days timeline
|
||||
masterUpdate(256);
|
||||
|
||||
// Check if we have terminal and file access
|
||||
var terminalAccess = ((meshrights == 0xFFFFFFFF) || ((meshrights & 512) == 0));
|
||||
var fileAccess = ((meshrights == 0xFFFFFFFF) || ((meshrights & 1024) == 0));
|
||||
var amtAccess = ((meshrights == 0xFFFFFFFF) || ((meshrights & 2048) == 0));
|
||||
|
||||
// Show bottom buttons
|
||||
x = '<div class="p10html3right">';
|
||||
if ((meshrights & 4) != 0) {
|
||||
|
@ -4796,7 +4802,8 @@
|
|||
x += '<img title=\"' + "Place link to this device in the clipboard" + '\" src="images/link1.png" style=cursor:pointer onclick=p10deviceLinkToClipboard() /> ';
|
||||
if (mesh.mtype == 2) x += '<a href=# onclick=p10showNodeNetInfoDialog("' + node._id + '") title=\"' + "Show device network interface information" + '\">' + "Interfaces" + '</a> ';
|
||||
if (xxmap != null) x += '<a href=# onclick=p10showNodeLocationDialog("' + node._id + '") title=\"' + "Show device locations information" + '\">' + "Location" + '</a> ';
|
||||
if (((meshrights & 8) != 0) && (mesh.mtype == 2)) x += '<a href=# onclick=p10showMeshCmdDialog(1,"' + node._id + '") title=\"' + "Traffic router used to connect to a device thru this server" + '.\">' + "Router" + '</a> ';
|
||||
if ((terminalAccess) && ((meshrights & 8) != 0) && (mesh.mtype == 2)) x += '<a href=# onclick=p10showMeshCmdDialog(1,"' + node._id + '") title=\"' + "Traffic router used to connect to a device thru this server" + '.\">' + "Router" + '</a> ';
|
||||
if ((mesh.mtype == 2) && ((node.agent.caps & 2) != 0) && ((meshrights & 8) != 0) && ((meshrights == 0xFFFFFFFF) || ((meshrights & 512) == 0))) { x += '<a href=# onclick=p10openxterm(event,"' + node._id + '") title=\"' + "Open XTerm terminal" + '\">' + "XTerm" + '</a> '; }
|
||||
|
||||
// RDP link, show this link only of the remote machine is Windows.
|
||||
if (((connectivity & 1) != 0) && (clickOnce == true) && (mesh.mtype == 2) && ((meshrights & 8) != 0)) {
|
||||
|
@ -4827,11 +4834,6 @@
|
|||
Q('MainComputerImage').setAttribute('src', 'images/icons256-' + node.icon + '-1.png');
|
||||
Q('MainComputerImage').className = ((!node.conn) || (node.conn == 0)?'gray':'');
|
||||
|
||||
// Check if we have terminal and file access
|
||||
var terminalAccess = ((meshrights == 0xFFFFFFFF) || ((meshrights & 512) == 0));
|
||||
var fileAccess = ((meshrights == 0xFFFFFFFF) || ((meshrights & 1024) == 0));
|
||||
var amtAccess = ((meshrights == 0xFFFFFFFF) || ((meshrights & 2048) == 0));
|
||||
|
||||
// Setup/Refresh the desktop tab
|
||||
if (terminalAccess) { setupTerminal(); }
|
||||
if (fileAccess) { setupFiles(); }
|
||||
|
@ -5262,7 +5264,18 @@
|
|||
function p10showMqttLoginDialog(nodeid) { meshserver.send({ action: 'getmqttlogin', nodeid: nodeid }); }
|
||||
|
||||
// Place a device link URL in the clipboard
|
||||
function p10deviceLinkToClipboard() { copyTextToClip2(document.URL.split('?')[0].split('#')[0] + '?node=' + currentNode._id.split('/')[2] + '&viewmode=10'); }
|
||||
function p10deviceLinkToClipboard() { copyTextToClip2(document.URL.split('?')[0].split('#')[0] + '?gotonode=' + currentNode._id.split('/')[2] + '&viewmode=10'); }
|
||||
|
||||
// Open XTerm
|
||||
function p10openxterm(e, nodeid) {
|
||||
haltEvent(e);
|
||||
var url = '/xterm?nodeid=' + encodeURIComponent(nodeid) + '&auto=1';
|
||||
var node = getNodeFromId(nodeid);
|
||||
if (node == null) return;
|
||||
if ([1, 2, 3, 4, 21, 22].indexOf(node.agent.id) >= 0) { url += '&fixsize=1'; }
|
||||
window.open(url, 'xterm:' + nodeid);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Show MeshCmd dialog
|
||||
function p10showMeshCmdDialog(mode, nodeid) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue