mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-12 15:33:20 -05:00
Invitation link fixes, xTerm terminal title support.
This commit is contained in:
parent
b676ab7e16
commit
15aaecf171
@ -834,9 +834,10 @@ function createMeshCore(agent) {
|
|||||||
} else {
|
} else {
|
||||||
if (fs.existsSync("/bin/bash")) {
|
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 });
|
||||||
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("alias ls='ls --color=auto'\nclear\n"); }
|
||||||
} else {
|
} else {
|
||||||
this.httprequest.process = childProcess.execFile("/bin/sh", ["sh"], { type: childProcess.SpawnTypes.TERM });
|
this.httprequest.process = childProcess.execFile("/bin/sh", ["sh"], { type: childProcess.SpawnTypes.TERM });
|
||||||
|
if (process.platform == 'linux') { this.httprequest.process.stdin.write("stty erase ^H\nalias ls='ls --color=auto'\nPS1='\\u@\\h:\\w\\$ '\nclear\n"); }
|
||||||
}
|
}
|
||||||
//if (this.httprequest.process == null) { }
|
//if (this.httprequest.process == null) { }
|
||||||
this.httprequest.process.tunnel = this;
|
this.httprequest.process.tunnel = this;
|
||||||
|
2
agents/meshcore.min.js
vendored
2
agents/meshcore.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "meshcentral",
|
"name": "meshcentral",
|
||||||
"version": "0.3.5-x",
|
"version": "0.3.5-y",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Remote Management",
|
"Remote Management",
|
||||||
"Intel AMT",
|
"Intel AMT",
|
||||||
|
@ -47,6 +47,8 @@ var CreateAmtRemoteTerminal = function (divid) {
|
|||||||
var _scrollRegion = [0, 24];
|
var _scrollRegion = [0, 24];
|
||||||
var _altKeypadMode = false;
|
var _altKeypadMode = false;
|
||||||
var scrollBackBuffer = [];
|
var scrollBackBuffer = [];
|
||||||
|
obj.title = null;
|
||||||
|
obj.onTitleChange = null;
|
||||||
|
|
||||||
obj.Start = function () { }
|
obj.Start = function () { }
|
||||||
|
|
||||||
@ -104,6 +106,9 @@ var CreateAmtRemoteTerminal = function (divid) {
|
|||||||
case ')':
|
case ')':
|
||||||
_termstate = 5;
|
_termstate = 5;
|
||||||
break;
|
break;
|
||||||
|
case ']':
|
||||||
|
_termstate = 6; // xterm strings
|
||||||
|
break;
|
||||||
case '=':
|
case '=':
|
||||||
// Set alternate keypad mode
|
// Set alternate keypad mode
|
||||||
_altKeypadMode = true;
|
_altKeypadMode = true;
|
||||||
@ -169,6 +174,26 @@ var CreateAmtRemoteTerminal = function (divid) {
|
|||||||
case 5: // ')' Code
|
case 5: // ')' Code
|
||||||
_termstate = 0;
|
_termstate = 0;
|
||||||
break;
|
break;
|
||||||
|
case 6: // ']' Code, xterm
|
||||||
|
const bx = b.charCodeAt(0);
|
||||||
|
if (b == ';') {
|
||||||
|
_escNumberPtr++;
|
||||||
|
} else if (bx == 7) {
|
||||||
|
_ProcessXTermHandler(_escNumber);
|
||||||
|
_termstate = 0;
|
||||||
|
} else {
|
||||||
|
if (!_escNumber[_escNumberPtr]) { _escNumber[_escNumberPtr] = b; }
|
||||||
|
else { _escNumber[_escNumberPtr] += b; }
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function _ProcessXTermHandler(_escNumber) {
|
||||||
|
if (_escNumber.length == 0) return;
|
||||||
|
var cmd = parseInt(_escNumber[0]);
|
||||||
|
if ((cmd == 0 || cmd == 2) && (_escNumber.length > 1) && (_escNumber[1] != '?')) {
|
||||||
|
if (obj.onTitleChange) { obj.onTitleChange(obj, obj.title = _escNumber[1]); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,10 +278,10 @@
|
|||||||
QH('unlinuxinstall', linuxUnInstall);
|
QH('unlinuxinstall', linuxUnInstall);
|
||||||
|
|
||||||
// Attempt to detect the most likely operating system for this browser
|
// Attempt to detect the most likely operating system for this browser
|
||||||
if (navigator.userAgent.indexOf('Win64')) { openTab(null, 'wintab64'); }
|
if (navigator.userAgent.indexOf('Win64') >= 0) { openTab(null, 'wintab64'); }
|
||||||
else if (navigator.userAgent.indexOf('Windows')) { openTab(null, 'wintab32'); }
|
else if (navigator.userAgent.indexOf('Windows') >= 0) { openTab(null, 'wintab32'); }
|
||||||
else if (navigator.userAgent.indexOf('Linux')) { openTab(null, 'linuxtab'); }
|
else if (navigator.userAgent.indexOf('Linux') >= 0) { openTab(null, 'linuxtab'); }
|
||||||
else if (navigator.userAgent.indexOf('Macintosh')) { openTab(null, 'macostab'); }
|
else if (navigator.userAgent.indexOf('Macintosh') >= 0) { openTab(null, 'macostab'); }
|
||||||
else { openTab(null, 'wintab64'); }
|
else { openTab(null, 'wintab64'); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -525,7 +525,7 @@
|
|||||||
<span id="connectbutton2span"><input type="button" id="connectbutton2" value="Connect" onclick=connectTerminal(event,1) onkeypress="return false" onkeydown="return false" disabled="disabled"></span>
|
<span id="connectbutton2span"><input type="button" id="connectbutton2" value="Connect" onclick=connectTerminal(event,1) onkeypress="return false" onkeydown="return false" disabled="disabled"></span>
|
||||||
<span id="connectbutton2hspan"> <input type="button" id="connectbutton2h" value="HW Connect" onclick=connectTerminal(event,2) onkeypress="return false" onkeydown="return false" disabled="disabled"></span>
|
<span id="connectbutton2hspan"> <input type="button" id="connectbutton2h" value="HW Connect" onclick=connectTerminal(event,2) onkeypress="return false" onkeydown="return false" disabled="disabled"></span>
|
||||||
<span id="disconnectbutton2span"> <input type="button" id="disconnectbutton2" value="Disconnect" onclick=connectTerminal(event,0) onkeypress="return false" onkeydown="return false"></span>
|
<span id="disconnectbutton2span"> <input type="button" id="disconnectbutton2" value="Disconnect" onclick=connectTerminal(event,0) onkeypress="return false" onkeydown="return false"></span>
|
||||||
<span id="termstatus">Disconnected</span>
|
<span id="termstatus">Disconnected</span><span id="termtitle"></span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -5035,12 +5035,10 @@
|
|||||||
switch (state) {
|
switch (state) {
|
||||||
case 0:
|
case 0:
|
||||||
// Disconnected, clear the terminal
|
// Disconnected, clear the terminal
|
||||||
|
QH('termtitle', '');
|
||||||
xterminal.m.TermResetScreen();
|
xterminal.m.TermResetScreen();
|
||||||
xterminal.m.TermDraw();
|
xterminal.m.TermDraw();
|
||||||
if (terminal != null) {
|
if (terminal != null) { terminal.Stop(); terminal = null; }
|
||||||
terminal.Stop();
|
|
||||||
terminal = null;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
break;
|
break;
|
||||||
@ -5063,6 +5061,7 @@
|
|||||||
terminal = CreateAmtRedirect(CreateAmtRemoteTerminal('Term'), authCookie);
|
terminal = CreateAmtRedirect(CreateAmtRemoteTerminal('Term'), authCookie);
|
||||||
terminal.debugmode = debugmode;
|
terminal.debugmode = debugmode;
|
||||||
terminal.m.debugmode = debugmode;
|
terminal.m.debugmode = debugmode;
|
||||||
|
terminal.m.onTitleChange = function (sender, title) { QH('termtitle', ' - ' + EscapeHtml(title)); }
|
||||||
terminal.onStateChanged = onTerminalStateChange;
|
terminal.onStateChanged = onTerminalStateChange;
|
||||||
terminal.Start(terminalNode._id, 16994, '*', '*', 0);
|
terminal.Start(terminalNode._id, 16994, '*', '*', 0);
|
||||||
terminal.contype = 2;
|
terminal.contype = 2;
|
||||||
@ -5072,6 +5071,7 @@
|
|||||||
terminal = CreateAgentRedirect(meshserver, CreateAmtRemoteTerminal('Term'), serverPublicNamePort, authCookie, domainUrl);
|
terminal = CreateAgentRedirect(meshserver, CreateAmtRemoteTerminal('Term'), serverPublicNamePort, authCookie, domainUrl);
|
||||||
terminal.debugmode = debugmode;
|
terminal.debugmode = debugmode;
|
||||||
terminal.m.debugmode = debugmode;
|
terminal.m.debugmode = debugmode;
|
||||||
|
terminal.m.onTitleChange = function (sender, title) { QH('termtitle', ' - ' + EscapeHtml(title)); }
|
||||||
terminal.m.lineFeed = ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) >= 0) ? '\r\n' : '\r'; // On windows, send \r\n, on Linux only \r
|
terminal.m.lineFeed = ([1, 2, 3, 4, 21, 22].indexOf(currentNode.agent.id) >= 0) ? '\r\n' : '\r'; // On windows, send \r\n, on Linux only \r
|
||||||
terminal.attemptWebRTC = attemptWebRTC;
|
terminal.attemptWebRTC = attemptWebRTC;
|
||||||
terminal.onStateChanged = onTerminalStateChange;
|
terminal.onStateChanged = onTerminalStateChange;
|
||||||
|
Loading…
Reference in New Issue
Block a user