Added launching terminal as logged in user in Linux.
This commit is contained in:
parent
c0323f7a9d
commit
4930e7901d
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"manager": "C:\\Users\\Default.DESKTOP-M9I88C9\\Desktop\\AmtWebApp\\meshcentral\\letsencrypt.js"
|
|
||||||
}
|
|
|
@ -1046,11 +1046,11 @@ function createMeshCore(agent) {
|
||||||
if ((data == 'c') || (data == 'cr')) { this.httprequest.state = 1; /*sendConsoleText("Tunnel #" + this.httprequest.index + " now active", this.httprequest.sessionid);*/ }
|
if ((data == 'c') || (data == 'cr')) { this.httprequest.state = 1; /*sendConsoleText("Tunnel #" + this.httprequest.index + " now active", this.httprequest.sessionid);*/ }
|
||||||
} else {
|
} else {
|
||||||
// Handle tunnel data
|
// Handle tunnel data
|
||||||
if (this.httprequest.protocol == 0) { // 1 = Terminal, 2 = Desktop, 5 = Files, 6 = PowerShell
|
if (this.httprequest.protocol == 0) { // 1 = Terminal (admin), 2 = Desktop, 5 = Files, 6 = PowerShell (admin), 7 = Terminal (user), 8 = PowerShell (user)
|
||||||
// Take a look at the protocol
|
// Take a look at the protocol
|
||||||
this.httprequest.protocol = parseInt(data);
|
this.httprequest.protocol = parseInt(data);
|
||||||
if (typeof this.httprequest.protocol != 'number') { this.httprequest.protocol = 0; }
|
if (typeof this.httprequest.protocol != 'number') { this.httprequest.protocol = 0; }
|
||||||
if ((this.httprequest.protocol == 1) || (this.httprequest.protocol == 6)) {
|
if ((this.httprequest.protocol == 1) || (this.httprequest.protocol == 6) || (this.httprequest.protocol == 7) || (this.httprequest.protocol == 8)) {
|
||||||
// Check user access rights for terminal
|
// Check user access rights for terminal
|
||||||
if (((this.httprequest.rights & MESHRIGHT_REMOTECONTROL) == 0) || ((this.httprequest.rights != 0xFFFFFFFF) && ((this.httprequest.rights & MESHRIGHT_NOTERMINAL) != 0))) {
|
if (((this.httprequest.rights & MESHRIGHT_REMOTECONTROL) == 0) || ((this.httprequest.rights != 0xFFFFFFFF) && ((this.httprequest.rights & MESHRIGHT_NOTERMINAL) != 0))) {
|
||||||
// Disengage this tunnel, user does not have the rights to do this!!
|
// Disengage this tunnel, user does not have the rights to do this!!
|
||||||
|
@ -1083,10 +1083,10 @@ function createMeshCore(agent) {
|
||||||
// Remote terminal using native pipes
|
// Remote terminal using native pipes
|
||||||
if (process.platform == "win32") {
|
if (process.platform == "win32") {
|
||||||
try {
|
try {
|
||||||
if ((this.httprequest.protocol == 6) && (require('win-terminal').PowerShellCapable() == true)) {
|
if (((this.httprequest.protocol == 6) || (this.httprequest.protocol == 8)) && (require('win-terminal').PowerShellCapable() == true)) {
|
||||||
this.httprequest._term = require('win-terminal').StartPowerShell(80, 25);
|
this.httprequest._term = require('win-terminal').StartPowerShell(80, 25); // TODO: Start as logged in used when protocol is 8
|
||||||
} else {
|
} else {
|
||||||
this.httprequest._term = require('win-terminal').Start(80, 25);
|
this.httprequest._term = require('win-terminal').Start(80, 25); // TODO: Start as logged in used when protocol is 7
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
@ -1100,13 +1100,13 @@ function createMeshCore(agent) {
|
||||||
this.prependListener('end', function () { this.httprequest._term.end(function () { console.log('Terminal was closed'); }); });
|
this.prependListener('end', function () { this.httprequest._term.end(function () { console.log('Terminal was closed'); }); });
|
||||||
} else {
|
} else {
|
||||||
if (fs.existsSync("/usr/bin/python") && fs.existsSync("/bin/bash")) {
|
if (fs.existsSync("/usr/bin/python") && fs.existsSync("/bin/bash")) {
|
||||||
this.httprequest.process = childProcess.execFile("/usr/bin/python", [ "python", "-c", "import pty; pty.spawn([\"/bin/bash\"])" ]);
|
this.httprequest.process = childProcess.execFile("/usr/bin/python", ["python", "-c", "import pty; pty.spawn([\"/bin/bash\"])"], { uid: (this.httprequest.protocol == 7) ? require('user-sessions').consoleUid() : null }); // Start as active user
|
||||||
if (process.platform == 'linux') { this.httprequest.process.stdin.write("export TERM='xterm'\nalias ls='ls --color=auto'\nclear\n"); }
|
if (process.platform == 'linux') { this.httprequest.process.stdin.write("export TERM='xterm'\nalias ls='ls --color=auto'\nclear\n"); }
|
||||||
} else if (fs.existsSync("/bin/bash")) {
|
} else if (fs.existsSync("/bin/bash")) {
|
||||||
this.httprequest.process = childProcess.execFile("/bin/bash", ["bash", "-i"], { type: childProcess.SpawnTypes.TERM });
|
this.httprequest.process = childProcess.execFile("/bin/bash", ["bash", "-i"], { type: childProcess.SpawnTypes.TERM, uid: (this.httprequest.protocol == 7) ? require('user-sessions').consoleUid() : null }); // Start as active user
|
||||||
if (process.platform == 'linux') { this.httprequest.process.stdin.write("alias ls='ls --color=auto'\nclear\n"); }
|
if (process.platform == 'linux') { this.httprequest.process.stdin.write("alias ls='ls --color=auto'\nclear\n"); }
|
||||||
} else {
|
} else {
|
||||||
this.httprequest.process = childProcess.execFile("/bin/sh", ["sh"], { type: childProcess.SpawnTypes.TERM }); // , uid: require('user-sessions').consoleUid()
|
this.httprequest.process = childProcess.execFile("/bin/sh", ["sh"], { type: childProcess.SpawnTypes.TERM, uid: (this.httprequest.protocol == 7)?require('user-sessions').consoleUid():null }); // Start as active user
|
||||||
if (process.platform == 'linux') { this.httprequest.process.stdin.write("stty erase ^H\nalias ls='ls --color=auto'\nPS1='\\u@\\h:\\w\\$ '\nclear\n"); }
|
if (process.platform == 'linux') { this.httprequest.process.stdin.write("stty erase ^H\nalias ls='ls --color=auto'\nPS1='\\u@\\h:\\w\\$ '\nclear\n"); }
|
||||||
}
|
}
|
||||||
this.httprequest.process.tunnel = this;
|
this.httprequest.process.tunnel = this;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "meshcentral",
|
"name": "meshcentral",
|
||||||
"version": "0.4.4-s",
|
"version": "0.4.4-u",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Remote Management",
|
"Remote Management",
|
||||||
"Intel AMT",
|
"Intel AMT",
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -54,8 +54,12 @@
|
||||||
-->
|
-->
|
||||||
</div>
|
</div>
|
||||||
<div id="termShellContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
|
<div id="termShellContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
|
||||||
<div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)">Normal Connect</div>
|
<div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)"><b>Normal Connect</b></div>
|
||||||
<div id="cxtermps" class="cmtext" onclick="cmtermaction(2,event)">PowerShell Connect</div>
|
<div id="cxtermps" class="cmtext" onclick="cmtermaction(6,event)">PowerShell Connect</div>
|
||||||
|
</div>
|
||||||
|
<div id="termShellContextMenuLinux" class="contextMenu noselect" style="display:none;min-width:0px">
|
||||||
|
<div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)"><b>Root Shell</b></div>
|
||||||
|
<div id="cxtermps" class="cmtext" onclick="cmtermaction(7,event)">User Shell</div>
|
||||||
</div>
|
</div>
|
||||||
<!--
|
<!--
|
||||||
<div id="pluginTabContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
|
<div id="pluginTabContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
|
||||||
|
@ -3539,18 +3543,24 @@
|
||||||
contextmenudiv.style.left = event.pageX + 'px';
|
contextmenudiv.style.left = event.pageX + 'px';
|
||||||
contextmenudiv.style.top = event.pageY + 'px';
|
contextmenudiv.style.top = event.pageY + 'px';
|
||||||
contextmenudiv.style.display = 'block';
|
contextmenudiv.style.display = 'block';
|
||||||
|
} else if (elem && elem != null && elem.id == 'connectbutton2' && currentNode && currentNode.agent && (currentNode.agent.id > 4)) {
|
||||||
|
contextelement = elem;
|
||||||
|
var contextmenudiv = document.getElementById('termShellContextMenuLinux');
|
||||||
|
contextmenudiv.style.left = event.pageX + 'px';
|
||||||
|
contextmenudiv.style.top = event.pageY + 'px';
|
||||||
|
contextmenudiv.style.display = 'block';
|
||||||
} else if (elem && elem != null && elem.id == 'MxMESH') {
|
} else if (elem && elem != null && elem.id == 'MxMESH') {
|
||||||
contextelement = elem;
|
contextelement = elem;
|
||||||
var contextmenudiv = document.getElementById('meshContextMenu');
|
var contextmenudiv = document.getElementById('meshContextMenu');
|
||||||
contextmenudiv.style.left = event.pageX + 'px';
|
contextmenudiv.style.left = event.pageX + 'px';
|
||||||
contextmenudiv.style.top = event.pageY + 'px';
|
contextmenudiv.style.top = event.pageY + 'px';
|
||||||
contextmenudiv.style.display = 'block';
|
contextmenudiv.style.display = 'block';
|
||||||
/*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
|
/*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
|
||||||
contextelement = elem;
|
contextelement = elem;
|
||||||
var contextmenudiv = document.getElementById('pluginTabContextMenu');
|
var contextmenudiv = document.getElementById('pluginTabContextMenu');
|
||||||
contextmenudiv.style.left = event.pageX + 'px';
|
contextmenudiv.style.left = event.pageX + 'px';
|
||||||
contextmenudiv.style.top = event.pageY + 'px';
|
contextmenudiv.style.top = event.pageY + 'px';
|
||||||
contextmenudiv.style.display = 'block';*/
|
contextmenudiv.style.display = 'block';*/
|
||||||
} else {
|
} else {
|
||||||
while (elem && elem != null && elem.id != 'devs') { elem = elem.parentElement; }
|
while (elem && elem != null && elem.id != 'devs') { elem = elem.parentElement; }
|
||||||
if (!elem || elem == null) return true;
|
if (!elem || elem == null) return true;
|
||||||
|
@ -3619,7 +3629,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmtermaction(action) {
|
function cmtermaction(action) {
|
||||||
connectTerminal(null, 1, { powershell: (action == 2) });
|
connectTerminal(null, 1, { protocol: action });
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3638,6 +3648,7 @@
|
||||||
QV('contextMenu', false);
|
QV('contextMenu', false);
|
||||||
QV('meshContextMenu', false);
|
QV('meshContextMenu', false);
|
||||||
QV('termShellContextMenu', false);
|
QV('termShellContextMenu', false);
|
||||||
|
QV('termShellContextMenuLinux', false);
|
||||||
//QV('pluginTabContextMenu', false);
|
//QV('pluginTabContextMenu', false);
|
||||||
contextelement = null;
|
contextelement = null;
|
||||||
}
|
}
|
||||||
|
@ -4038,7 +4049,7 @@
|
||||||
// Called When Place a node option is clicked from context menu
|
// Called When Place a node option is clicked from context menu
|
||||||
function placeNode(coords) {
|
function placeNode(coords) {
|
||||||
if (xxdialogMode) return;
|
if (xxdialogMode) return;
|
||||||
var x = '<div style=margin-bottom:6px><label for=selectnode-search>Search</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "No devices found." + '</div>';
|
var x = '<div style=margin-bottom:6px><label for=selectnode-search>' + "Search" + '</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "No devices found." + '</div>';
|
||||||
for (var i in nodes) {
|
for (var i in nodes) {
|
||||||
x += '<div class=noselect id=' + nodes[i]._id + '-rowid onclick=selectNodeToPlace(event,\''+ nodes[i]._id +'\') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id=' + nodes[i]._id + '-checkid type=checkbox style=width:16px;display:inline />';
|
x += '<div class=noselect id=' + nodes[i]._id + '-rowid onclick=selectNodeToPlace(event,\''+ nodes[i]._id +'\') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id=' + nodes[i]._id + '-checkid type=checkbox style=width:16px;display:inline />';
|
||||||
x += '<div class=j' + nodes[i].icon + ' style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>' + nodes[i].name + '</div></div>';
|
x += '<div class=j' + nodes[i].icon + ' style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>' + nodes[i].name + '</div></div>';
|
||||||
|
@ -5902,7 +5913,7 @@
|
||||||
Q('id_ttypebutton').value = terminalEmulations[terminal.m.terminalEmulation];
|
Q('id_ttypebutton').value = terminalEmulations[terminal.m.terminalEmulation];
|
||||||
} else {
|
} else {
|
||||||
// Setup a mesh agent terminal
|
// Setup a mesh agent terminal
|
||||||
var termoptions = {};
|
var termoptions = { protocol: ((options != null) && (typeof options.protocol == 'number'))?options.protocol:1 };
|
||||||
if ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) == -1) {
|
if ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) == -1) {
|
||||||
if (Q('termSizeList').value == 2) { termoptions.width = 100; termoptions.height = 30; termoptions.xterm = true; }
|
if (Q('termSizeList').value == 2) { termoptions.width = 100; termoptions.height = 30; termoptions.xterm = true; }
|
||||||
if (Q('termSizeList').value == 3) {
|
if (Q('termSizeList').value == 3) {
|
||||||
|
@ -5912,7 +5923,16 @@
|
||||||
termoptions.xterm = true;
|
termoptions.xterm = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((e && (e.shiftKey == true)) || (options && (options.powershell))) { termoptions.protocol = 6; }
|
|
||||||
|
// If shift is pressed
|
||||||
|
if ((e && (e.shiftKey == true))) {
|
||||||
|
if (currentNode.agent.id > 4) {
|
||||||
|
if (termoptions.protocol == 1) { termoptions.protocol = 7; } // Switch to user shell
|
||||||
|
} else {
|
||||||
|
if (termoptions.protocol == 1) { termoptions.protocol = 6; } // Switch to Powershell
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
terminal = CreateAgentRedirect(meshserver, CreateAmtRemoteTerminal('Term', termoptions), serverPublicNamePort, authCookie, authRelayCookie, domainUrl);
|
terminal = CreateAgentRedirect(meshserver, CreateAmtRemoteTerminal('Term', termoptions), serverPublicNamePort, authCookie, authRelayCookie, domainUrl);
|
||||||
terminal.debugmode = debugmode;
|
terminal.debugmode = debugmode;
|
||||||
terminal.m.debugmode = debugmode;
|
terminal.m.debugmode = debugmode;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -52,8 +52,12 @@
|
||||||
-->
|
-->
|
||||||
</div>
|
</div>
|
||||||
<div id="termShellContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
|
<div id="termShellContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
|
||||||
<div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)">Normal Connect</div>
|
<div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)"><b>Normal Connect</b></div>
|
||||||
<div id="cxtermps" class="cmtext" onclick="cmtermaction(2,event)">PowerShell Connect</div>
|
<div id="cxtermps" class="cmtext" onclick="cmtermaction(6,event)">PowerShell Connect</div>
|
||||||
|
</div>
|
||||||
|
<div id="termShellContextMenuLinux" class="contextMenu noselect" style="display:none;min-width:0px">
|
||||||
|
<div id="cxtermnorm" class="cmtext" onclick="cmtermaction(1,event)"><b>Root Shell</b></div>
|
||||||
|
<div id="cxtermps" class="cmtext" onclick="cmtermaction(7,event)">User Shell</div>
|
||||||
</div>
|
</div>
|
||||||
<!--
|
<!--
|
||||||
<div id="pluginTabContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
|
<div id="pluginTabContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
|
||||||
|
@ -112,7 +116,6 @@
|
||||||
<td tabindex="0" id="MainMenuMyFiles" class="topbar_td style3x" onclick="go(5,event)" onkeypress="if (event.key == 'Enter') go(5)">Mes Dossiers</td>
|
<td tabindex="0" id="MainMenuMyFiles" class="topbar_td style3x" onclick="go(5,event)" onkeypress="if (event.key == 'Enter') go(5)">Mes Dossiers</td>
|
||||||
<td tabindex="0" id="MainMenuMyUsers" class="topbar_td style3x" onclick="go(4,event)" onkeypress="if (event.key == 'Enter') go(4)">Mes Utilisateurs</td>
|
<td tabindex="0" id="MainMenuMyUsers" class="topbar_td style3x" onclick="go(4,event)" onkeypress="if (event.key == 'Enter') go(4)">Mes Utilisateurs</td>
|
||||||
<td tabindex="0" id="MainMenuMyServer" class="topbar_td style3x" onclick="go(6,event)" onkeypress="if (event.key == 'Enter') go(6)">Mon Serveur</td>
|
<td tabindex="0" id="MainMenuMyServer" class="topbar_td style3x" onclick="go(6,event)" onkeypress="if (event.key == 'Enter') go(6)">Mon Serveur</td>
|
||||||
<!-- <td tabindex=0 id=MainMenuMyPlugins class="topbar_td style3x" onclick=go(7,event) onkeypress="if (event.key == 'Enter') go(7)">My Plugins</td> -->
|
|
||||||
<td class="topbar_td_end style3"> </td>
|
<td class="topbar_td_end style3"> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
|
@ -161,15 +164,6 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
</div>
|
</div>
|
||||||
<!--
|
|
||||||
<div id=PluginSubMenuSpan>
|
|
||||||
<table id=PluginSubMenu cellpadding=0 cellspacing=0 class=style1>
|
|
||||||
<tr>
|
|
||||||
<td onclick="goPlugin(-1)" onkeypress="if (event.key == 'Enter') goPlugin(-1)" class="topbar_td style3x">Home</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
<div id="UserDummyMenuSpan">
|
<div id="UserDummyMenuSpan">
|
||||||
<table id="UserDummyMenu" cellpadding="0" cellspacing="0" class="style1">
|
<table id="UserDummyMenu" cellpadding="0" cellspacing="0" class="style1">
|
||||||
<tbody><tr><td class="style3" style=""> </td></tr>
|
<tbody><tr><td class="style3" style=""> </td></tr>
|
||||||
|
@ -3547,18 +3541,24 @@
|
||||||
contextmenudiv.style.left = event.pageX + 'px';
|
contextmenudiv.style.left = event.pageX + 'px';
|
||||||
contextmenudiv.style.top = event.pageY + 'px';
|
contextmenudiv.style.top = event.pageY + 'px';
|
||||||
contextmenudiv.style.display = 'block';
|
contextmenudiv.style.display = 'block';
|
||||||
|
} else if (elem && elem != null && elem.id == 'connectbutton2' && currentNode && currentNode.agent && (currentNode.agent.id > 4)) {
|
||||||
|
contextelement = elem;
|
||||||
|
var contextmenudiv = document.getElementById('termShellContextMenuLinux');
|
||||||
|
contextmenudiv.style.left = event.pageX + 'px';
|
||||||
|
contextmenudiv.style.top = event.pageY + 'px';
|
||||||
|
contextmenudiv.style.display = 'block';
|
||||||
} else if (elem && elem != null && elem.id == 'MxMESH') {
|
} else if (elem && elem != null && elem.id == 'MxMESH') {
|
||||||
contextelement = elem;
|
contextelement = elem;
|
||||||
var contextmenudiv = document.getElementById('meshContextMenu');
|
var contextmenudiv = document.getElementById('meshContextMenu');
|
||||||
contextmenudiv.style.left = event.pageX + 'px';
|
contextmenudiv.style.left = event.pageX + 'px';
|
||||||
contextmenudiv.style.top = event.pageY + 'px';
|
contextmenudiv.style.top = event.pageY + 'px';
|
||||||
contextmenudiv.style.display = 'block';
|
contextmenudiv.style.display = 'block';
|
||||||
/*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
|
/*} else if (elem && elem != null && elem.classList.contains('pluginTab')) {
|
||||||
contextelement = elem;
|
contextelement = elem;
|
||||||
var contextmenudiv = document.getElementById('pluginTabContextMenu');
|
var contextmenudiv = document.getElementById('pluginTabContextMenu');
|
||||||
contextmenudiv.style.left = event.pageX + 'px';
|
contextmenudiv.style.left = event.pageX + 'px';
|
||||||
contextmenudiv.style.top = event.pageY + 'px';
|
contextmenudiv.style.top = event.pageY + 'px';
|
||||||
contextmenudiv.style.display = 'block';*/
|
contextmenudiv.style.display = 'block';*/
|
||||||
} else {
|
} else {
|
||||||
while (elem && elem != null && elem.id != 'devs') { elem = elem.parentElement; }
|
while (elem && elem != null && elem.id != 'devs') { elem = elem.parentElement; }
|
||||||
if (!elem || elem == null) return true;
|
if (!elem || elem == null) return true;
|
||||||
|
@ -3627,7 +3627,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function cmtermaction(action) {
|
function cmtermaction(action) {
|
||||||
connectTerminal(null, 1, { powershell: (action == 2) });
|
connectTerminal(null, 1, { protocol: action });
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3646,6 +3646,7 @@
|
||||||
QV('contextMenu', false);
|
QV('contextMenu', false);
|
||||||
QV('meshContextMenu', false);
|
QV('meshContextMenu', false);
|
||||||
QV('termShellContextMenu', false);
|
QV('termShellContextMenu', false);
|
||||||
|
QV('termShellContextMenuLinux', false);
|
||||||
//QV('pluginTabContextMenu', false);
|
//QV('pluginTabContextMenu', false);
|
||||||
contextelement = null;
|
contextelement = null;
|
||||||
}
|
}
|
||||||
|
@ -4046,7 +4047,7 @@
|
||||||
// Called When Place a node option is clicked from context menu
|
// Called When Place a node option is clicked from context menu
|
||||||
function placeNode(coords) {
|
function placeNode(coords) {
|
||||||
if (xxdialogMode) return;
|
if (xxdialogMode) return;
|
||||||
var x = '<div style=margin-bottom:6px><label for=selectnode-search>Search</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "Aucun périphérique trouvé." + '</div>';
|
var x = '<div style=margin-bottom:6px><label for=selectnode-search>' + "Chercher" + '</label>  <input type=text placeholder="' + "Device name" + '" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>' + "Aucun périphérique trouvé." + '</div>';
|
||||||
for (var i in nodes) {
|
for (var i in nodes) {
|
||||||
x += '<div class=noselect id=' + nodes[i]._id + '-rowid onclick=selectNodeToPlace(event,\''+ nodes[i]._id +'\') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id=' + nodes[i]._id + '-checkid type=checkbox style=width:16px;display:inline />';
|
x += '<div class=noselect id=' + nodes[i]._id + '-rowid onclick=selectNodeToPlace(event,\''+ nodes[i]._id +'\') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id=' + nodes[i]._id + '-checkid type=checkbox style=width:16px;display:inline />';
|
||||||
x += '<div class=j' + nodes[i].icon + ' style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>' + nodes[i].name + '</div></div>';
|
x += '<div class=j' + nodes[i].icon + ' style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>' + nodes[i].name + '</div></div>';
|
||||||
|
@ -5910,7 +5911,7 @@
|
||||||
Q('id_ttypebutton').value = terminalEmulations[terminal.m.terminalEmulation];
|
Q('id_ttypebutton').value = terminalEmulations[terminal.m.terminalEmulation];
|
||||||
} else {
|
} else {
|
||||||
// Setup a mesh agent terminal
|
// Setup a mesh agent terminal
|
||||||
var termoptions = {};
|
var termoptions = { protocol: ((options != null) && (typeof options.protocol == 'number'))?options.protocol:1 };
|
||||||
if ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) == -1) {
|
if ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) == -1) {
|
||||||
if (Q('termSizeList').value == 2) { termoptions.width = 100; termoptions.height = 30; termoptions.xterm = true; }
|
if (Q('termSizeList').value == 2) { termoptions.width = 100; termoptions.height = 30; termoptions.xterm = true; }
|
||||||
if (Q('termSizeList').value == 3) {
|
if (Q('termSizeList').value == 3) {
|
||||||
|
@ -5920,7 +5921,16 @@
|
||||||
termoptions.xterm = true;
|
termoptions.xterm = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((e && (e.shiftKey == true)) || (options && (options.powershell))) { termoptions.protocol = 6; }
|
|
||||||
|
// If shift is pressed
|
||||||
|
if ((e && (e.shiftKey == true))) {
|
||||||
|
if (currentNode.agent.id > 4) {
|
||||||
|
if (termoptions.protocol == 1) { termoptions.protocol = 7; } // Switch to user shell
|
||||||
|
} else {
|
||||||
|
if (termoptions.protocol == 1) { termoptions.protocol = 6; } // Switch to Powershell
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
terminal = CreateAgentRedirect(meshserver, CreateAmtRemoteTerminal('Term', termoptions), serverPublicNamePort, authCookie, authRelayCookie, domainUrl);
|
terminal = CreateAgentRedirect(meshserver, CreateAmtRemoteTerminal('Term', termoptions), serverPublicNamePort, authCookie, authRelayCookie, domainUrl);
|
||||||
terminal.debugmode = debugmode;
|
terminal.debugmode = debugmode;
|
||||||
terminal.m.debugmode = debugmode;
|
terminal.m.debugmode = debugmode;
|
||||||
|
@ -9420,6 +9430,7 @@
|
||||||
// My Server
|
// My Server
|
||||||
if ((x == 6) || (x == 115)) QC('MainMenuMyServer').add(mainMenuActiveClass);
|
if ((x == 6) || (x == 115)) QC('MainMenuMyServer').add(mainMenuActiveClass);
|
||||||
if ((x == 6) || (x == 115) || (x == 40) || (x == 41) || (x == 42)) QC('LeftMenuMyServer').add(leftMenuActiveClass);
|
if ((x == 6) || (x == 115) || (x == 40) || (x == 41) || (x == 42)) QC('LeftMenuMyServer').add(leftMenuActiveClass);
|
||||||
|
QV('ServerPlugins', pluginHandler != null);
|
||||||
|
|
||||||
// column_l max-height
|
// column_l max-height
|
||||||
if (webPageStackMenu && (x >= 10)) { QC('column_l').add('room4submenu'); } else { QC('column_l').remove('room4submenu'); }
|
if (webPageStackMenu && (x >= 10)) { QC('column_l').add('room4submenu'); } else { QC('column_l').remove('room4submenu'); }
|
||||||
|
@ -9468,8 +9479,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plugin
|
//
|
||||||
|
// Plugin Management
|
||||||
|
//
|
||||||
|
|
||||||
function updatePluginList(versInfo) {
|
function updatePluginList(versInfo) {
|
||||||
|
if (pluginHandler == null) return;
|
||||||
if (Array.isArray(versInfo)) { versInfo.forEach(function(v) { updatePluginList(v); }); }
|
if (Array.isArray(versInfo)) { versInfo.forEach(function(v) { updatePluginList(v); }); }
|
||||||
QV('pluginNoneNotice', installedPluginList.length == 0);
|
QV('pluginNoneNotice', installedPluginList.length == 0);
|
||||||
if (installedPluginList.length) {
|
if (installedPluginList.length) {
|
||||||
|
@ -9560,15 +9575,18 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshPluginLatest() {
|
function refreshPluginLatest() {
|
||||||
|
if (pluginHandler == null) return;
|
||||||
meshserver.send({ action: 'pluginLatestCheck' });
|
meshserver.send({ action: 'pluginLatestCheck' });
|
||||||
}
|
}
|
||||||
|
|
||||||
function distributeCore() {
|
function distributeCore() {
|
||||||
|
if (pluginHandler == null) return;
|
||||||
meshserver.send({ action: 'distributeCore', nodes: nodes }); // All nodes the user has access to
|
meshserver.send({ action: 'distributeCore', nodes: nodes }); // All nodes the user has access to
|
||||||
QV('pluginRestartNotice', false);
|
QV('pluginRestartNotice', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function pluginActionEx() {
|
function pluginActionEx() {
|
||||||
|
if (pluginHandler == null) return;
|
||||||
var act = Q('lastPluginAct').value, id = Q('lastPluginId').value, pVersUrl = Q('lastPluginVersion').value;
|
var act = Q('lastPluginAct').value, id = Q('lastPluginId').value, pVersUrl = Q('lastPluginVersion').value;
|
||||||
|
|
||||||
switch(act) {
|
switch(act) {
|
||||||
|
@ -9593,6 +9611,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function pluginAction(elem, id) {
|
function pluginAction(elem, id) {
|
||||||
|
if (pluginHandler == null) return;
|
||||||
if (elem.value == 'downgrade') {
|
if (elem.value == 'downgrade') {
|
||||||
meshserver.send({ 'action': 'getpluginversions', 'id': id });
|
meshserver.send({ 'action': 'getpluginversions', 'id': id });
|
||||||
} else {
|
} else {
|
||||||
|
@ -9604,6 +9623,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function goPlugin(pname, title) {
|
function goPlugin(pname, title) {
|
||||||
|
if (pluginHandler == null) return;
|
||||||
/*
|
/*
|
||||||
let holder = Q('PluginSubMenu').querySelectorAll('tr')[0];
|
let holder = Q('PluginSubMenu').querySelectorAll('tr')[0];
|
||||||
let loadedPluginsTDs = holder.querySelectorAll('td');
|
let loadedPluginsTDs = holder.querySelectorAll('td');
|
||||||
|
@ -9659,6 +9679,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function noGoPlugin(el) {
|
function noGoPlugin(el) {
|
||||||
|
if (pluginHandler == null) return;
|
||||||
/*
|
/*
|
||||||
QV('PluginSubMenuSpan', false);
|
QV('PluginSubMenuSpan', false);
|
||||||
let loadedPluginsTDs = Q('PluginSubMenu').querySelectorAll('td');
|
let loadedPluginsTDs = Q('PluginSubMenu').querySelectorAll('td');
|
||||||
|
|
Loading…
Reference in New Issue