New MeshAgents, much improved Linux terminal.

This commit is contained in:
Ylian Saint-Hilaire 2020-02-05 10:59:52 -08:00
parent 9046a946f7
commit 9ed44cef5f
22 changed files with 25 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,6 @@
{
"name": "meshcentral",
"version": "0.4.8-m",
"version": "0.4.8-o",
"keywords": [
"Remote Management",
"Intel AMT",

View File

@ -73,7 +73,7 @@ var CreateAmtRemoteTerminal = function (divid, options) {
}
obj.xxStateChange = function (newstate) {
if ((newstate == 3) && (options != null) && (options.xterm == true)) { obj.TermSendKeys(' stty rows ' + obj.height + ' cols ' + obj.width + '\n clear\n'); }
//if ((newstate == 3) && (options != null) && (options.xterm == true)) { obj.TermSendKeys(' stty rows ' + obj.height + ' cols ' + obj.width + '\n clear\n'); }
}
obj.ProcessData = function (str) {

View File

@ -10434,6 +10434,13 @@
"login.handlebars->container->column_l->centralTable->1->0->logincell->tokenpanel->1->7->1->4->1->1"
]
},
{
"en": "Login Shell",
"xloc": [
"default.handlebars->termShellContextMenuLinux->cxtermps",
"xterm.handlebars->termShellContextMenuLinux->cxtermps"
]
},
{
"cs": "Neplatné přihlášení, zkontrolujte uživatelské jméno a heslo.",
"de": "Anmeldung fehlgeschlagen, Benutzername und Passwort prüfen.",

View File

@ -64,6 +64,7 @@
<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(8,event)">User Shell</div>
<div id="cxtermps" class="cmtext" onclick="cmtermaction(100,event)">Login Shell</div>
</div>
<div id="altPortContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
<div id="cxaltport" class="cmtext" onclick="cmaltportaction(1,event)"><b>Alternate Port</b></div>
@ -4014,7 +4015,11 @@
}
function cmtermaction(action) {
connectTerminal(null, 1, { protocol: action });
if (action < 100) {
connectTerminal(null, 1, { protocol: action });
} else if (action == 100) {
connectTerminal(null, 1, { protocol: 1, requireLogin: true });
}
}
function cmaltportaction(action) {
@ -6343,6 +6348,7 @@
} else {
// Setup a mesh agent terminal
var termoptions = { protocol: ((options != null) && (typeof options.protocol == 'number'))?options.protocol:1 };
if (options && options.requireLogin) { termoptions.requireLogin = true; }
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 == 3) {
@ -6363,6 +6369,7 @@
}
terminal = CreateAgentRedirect(meshserver, CreateAmtRemoteTerminal('Term', termoptions), serverPublicNamePort, authCookie, authRelayCookie, domainUrl);
terminal.options = termoptions;
terminal.debugmode = debugmode;
terminal.m.debugmode = debugmode;
terminal.m.onTitleChange = function (sender, title) { QH('termtitle', ' - ' + EscapeHtml(title)); }

View File

@ -27,6 +27,7 @@
<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(8,event)">User Shell</div>
<div id="cxtermps" class="cmtext" onclick="cmtermaction(100,event)">Login Shell</div>
</div>
<div id=p11 class="noselect" style="overflow:hidden">
<div id=deskarea0 style="position:relative">
@ -161,11 +162,12 @@
if (resizeTimer) clearTimeout(resizeTimer);
resizeTimer = setTimeout(sendResize, 200);
});
term.setOption('convertEol', true); // Consider \n to be \r\n, this should be taken care of by "termios"
//term.setOption('convertEol', true); // Consider \n to be \r\n, this should be taken care of by "termios"
// Setup a terminal tunnel to the agent
tunnel = CreateAgentRedirect(meshserver, CreateRemoteTunnel(tunnelUpdate, options), serverPublicNamePort, authCookie, authRelayCookie, domainUrl);
tunnel.options = { cols: term.cols, rows: term.rows };
if (options && options.requireLogin) { tunnel.options.requireLogin = true; }
tunnel.Start(args.nodeid);
tunnel.onStateChanged = onTunnelStateChange;
tunnel.onConsoleMessageChange = function (server, msg) { setConsoleMsg(msg); };
@ -245,9 +247,11 @@
}
function cmtermaction(action) {
//console.log('cmtermaction', action);
connectButton({ protocol: action })
//connectTerminal(null, 1, { protocol: action });
if (action < 100) {
connectButton({ protocol: action })
} else if (action == 100) {
connectButton({ protocol: 1, requireLogin: true })
}
}
function hideContextMenu() {