mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-27 14:43:14 -05:00
Agent URL to clipboard, Terminal scroll back.
This commit is contained in:
parent
d3e1b2d387
commit
f2a5141b42
@ -477,10 +477,6 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
|
|||||||
}
|
}
|
||||||
obj.close(0);
|
obj.close(0);
|
||||||
});
|
});
|
||||||
ws._socket._parent.on('close', function (req) {
|
|
||||||
parent.agentStats.agentTcpClose++;
|
|
||||||
//if (obj.nodeid != null) { parent.parent.debug(1, 'Agent TCP disconnect ' + obj.nodeid + ' (' + obj.remoteaddrport + ')'); }
|
|
||||||
});
|
|
||||||
|
|
||||||
// Start authenticate the mesh agent by sending a auth nonce & server TLS cert hash.
|
// Start authenticate the mesh agent by sending a auth nonce & server TLS cert hash.
|
||||||
// Send 384 bits SHA384 hash of TLS cert public key + 384 bits nonce
|
// Send 384 bits SHA384 hash of TLS cert public key + 384 bits nonce
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "meshcentral",
|
"name": "meshcentral",
|
||||||
"version": "0.3.5-r",
|
"version": "0.3.5-s",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"Remote Management",
|
"Remote Management",
|
||||||
"Intel AMT",
|
"Intel AMT",
|
||||||
|
@ -737,7 +737,7 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
|
|||||||
if (k == 192) kk = 96; // `
|
if (k == 192) kk = 96; // `
|
||||||
if (k == 219) kk = 91; // [
|
if (k == 219) kk = 91; // [
|
||||||
if (k == 220) kk = 92; // \
|
if (k == 220) kk = 92; // \
|
||||||
if (k == 221) kk = 93; // ]t
|
if (k == 221) kk = 93; // ]
|
||||||
if (k == 222) kk = 39; // '
|
if (k == 222) kk = 39; // '
|
||||||
//console.log('Key' + d + ": " + k + " = " + kk);
|
//console.log('Key' + d + ": " + k + " = " + kk);
|
||||||
obj.sendkey(kk, d);
|
obj.sendkey(kk, d);
|
||||||
|
@ -45,6 +45,7 @@ var CreateAmtRemoteTerminal = function (divid) {
|
|||||||
var _cursorVisible = true;
|
var _cursorVisible = true;
|
||||||
var _scrollRegion = [0, 24];
|
var _scrollRegion = [0, 24];
|
||||||
var _altKeypadMode = false;
|
var _altKeypadMode = false;
|
||||||
|
var scrollBackBuffer = [];
|
||||||
|
|
||||||
obj.Start = function () { }
|
obj.Start = function () { }
|
||||||
|
|
||||||
@ -251,6 +252,7 @@ var CreateAmtRemoteTerminal = function (divid) {
|
|||||||
obj.TermClear((_TermCurrentBColor << 12) + (_TermCurrentFColor << 6)); // Erase entire screen
|
obj.TermClear((_TermCurrentBColor << 12) + (_TermCurrentFColor << 6)); // Erase entire screen
|
||||||
_termx = 0;
|
_termx = 0;
|
||||||
_termy = 0;
|
_termy = 0;
|
||||||
|
scrollBackBuffer = [];
|
||||||
}
|
}
|
||||||
else if (argslen == 0 || argslen == 1 && args[0] == 0) // Erase cursor down
|
else if (argslen == 0 || argslen == 1 && args[0] == 0) // Erase cursor down
|
||||||
{
|
{
|
||||||
@ -526,6 +528,7 @@ var CreateAmtRemoteTerminal = function (divid) {
|
|||||||
_termy++;
|
_termy++;
|
||||||
if (_termy > _scrollRegion[1]) {
|
if (_termy > _scrollRegion[1]) {
|
||||||
// Move everything up one line
|
// Move everything up one line
|
||||||
|
obj.recordLineTobackBuffer(0);
|
||||||
_TermMoveUp(1);
|
_TermMoveUp(1);
|
||||||
_termy = _scrollRegion[1];
|
_termy = _scrollRegion[1];
|
||||||
}
|
}
|
||||||
@ -544,7 +547,6 @@ var CreateAmtRemoteTerminal = function (divid) {
|
|||||||
_termx++;
|
_termx++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _TermDrawChar(c) {
|
function _TermDrawChar(c) {
|
||||||
@ -559,6 +561,7 @@ var CreateAmtRemoteTerminal = function (divid) {
|
|||||||
_scratt[y][x] = TermColor;
|
_scratt[y][x] = TermColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
scrollBackBuffer = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
obj.TermResetScreen = function () {
|
obj.TermResetScreen = function () {
|
||||||
@ -695,36 +698,57 @@ var CreateAmtRemoteTerminal = function (divid) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
obj.TermDraw = function() {
|
obj.recordLineTobackBuffer = function(y) {
|
||||||
var c, buf = '', closetag = '', newat, oldat = 1, x1, x2;
|
var closetag = '', buf = '';
|
||||||
for (var y = 0; y < obj.height; ++y) {
|
var r = obj.TermDrawLine(buf, y, closetag);
|
||||||
for (var x = 0; x < obj.width; ++x) {
|
buf = r[0];
|
||||||
newat = _scratt[y][x];
|
closetag = r[1];
|
||||||
if (_termx == x && _termy == y && _cursorVisible) { newat |= _VTREVERSE; } // If this is the cursor location, reverse the color.
|
scrollBackBuffer.push(buf + closetag + '<br>');
|
||||||
if (newat != oldat) {
|
if (scrollBackBuffer.length > 800) { scrollBackBuffer = scrollBackBuffer.slice(0, 800); }
|
||||||
buf += closetag;
|
}
|
||||||
closetag = '';
|
|
||||||
x1 = 6; x2 = 12;
|
|
||||||
if (newat & _VTREVERSE) { x1 = 12; x2 = 6; }
|
|
||||||
buf += '<span style="color:#' + _TermColors[(newat >> x1) & 0x3F] + ';background-color:#' + _TermColors[(newat >> x2) & 0x3F];
|
|
||||||
if (newat & _VTUNDERLINE) buf += ';text-decoration:underline';
|
|
||||||
buf += ';">';
|
|
||||||
closetag = "</span>" + closetag;
|
|
||||||
oldat = newat;
|
|
||||||
}
|
|
||||||
|
|
||||||
c = _tscreen[y][x];
|
obj.TermDrawLine = function (buf, y, closetag) {
|
||||||
switch (c) {
|
var newat, c, oldat = 1, x1, x2;
|
||||||
case '&': buf += '&'; break;
|
for (var x = 0; x < obj.width; ++x) {
|
||||||
case '<': buf += '<'; break;
|
newat = _scratt[y][x];
|
||||||
case '>': buf += '>'; break;
|
if (_termx == x && _termy == y && _cursorVisible) { newat |= _VTREVERSE; } // If this is the cursor location, reverse the color.
|
||||||
case ' ': buf += ' '; break;
|
if (newat != oldat) {
|
||||||
default: buf += c; break;
|
buf += closetag;
|
||||||
}
|
closetag = '';
|
||||||
|
x1 = 6; x2 = 12;
|
||||||
|
if (newat & _VTREVERSE) { x1 = 12; x2 = 6; }
|
||||||
|
buf += '<span style="color:#' + _TermColors[(newat >> x1) & 0x3F] + ';background-color:#' + _TermColors[(newat >> x2) & 0x3F];
|
||||||
|
if (newat & _VTUNDERLINE) buf += ';text-decoration:underline';
|
||||||
|
buf += ';">';
|
||||||
|
closetag = "</span>" + closetag;
|
||||||
|
oldat = newat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
c = _tscreen[y][x];
|
||||||
|
switch (c) {
|
||||||
|
case '&': buf += '&'; break;
|
||||||
|
case '<': buf += '<'; break;
|
||||||
|
case '>': buf += '>'; break;
|
||||||
|
case ' ': buf += ' '; break;
|
||||||
|
default: buf += c; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [buf, closetag];
|
||||||
|
}
|
||||||
|
|
||||||
|
obj.TermDraw = function() {
|
||||||
|
var closetag = '', buf = '';
|
||||||
|
for (var y = 0; y < obj.height; ++y) {
|
||||||
|
var r = obj.TermDrawLine(buf, y, closetag);
|
||||||
|
buf = r[0];
|
||||||
|
closetag = r[1];
|
||||||
if (y != (obj.height - 1)) buf += '<br>';
|
if (y != (obj.height - 1)) buf += '<br>';
|
||||||
}
|
}
|
||||||
obj.DivElement.innerHTML = "<font size='4'><b>" + buf + closetag + "</b></font>";
|
|
||||||
|
var backbuffer = '';
|
||||||
|
for (var i in scrollBackBuffer) { backbuffer += scrollBackBuffer[i]; }
|
||||||
|
obj.DivElement.innerHTML = "<font size='4'><b>" + backbuffer + buf + closetag + "</b></font>";
|
||||||
|
obj.DivElement.scrollTop = obj.DivElement.scrollHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
obj.TermInit = function () { obj.TermResetScreen(); }
|
obj.TermInit = function () { obj.TermResetScreen(); }
|
||||||
|
@ -2140,11 +2140,14 @@ a {
|
|||||||
#termarea3x {
|
#termarea3x {
|
||||||
background: black;
|
background: black;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
height: 500px;
|
height: 450px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
#Term {
|
#Term {
|
||||||
|
height: 450px;
|
||||||
|
max-height: 450px;
|
||||||
|
overflow-y: scroll;
|
||||||
background: black;
|
background: black;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -488,6 +488,8 @@
|
|||||||
<option value=3>Win+M</option>
|
<option value=3>Win+M</option>
|
||||||
<option value=4>Shift+Win+M</option>
|
<option value=4>Shift+Win+M</option>
|
||||||
<option value=6>Win+R</option>
|
<option value=6>Win+R</option>
|
||||||
|
<option value=7>Alt-F4</option>
|
||||||
|
<option value=8>Ctrl-W</option>
|
||||||
</select>
|
</select>
|
||||||
<input id="DeskWD" type=button value="Send" onkeypress="return false" onkeydown="return false" onclick="deskSendKeys()">
|
<input id="DeskWD" type=button value="Send" onkeypress="return false" onkeydown="return false" onclick="deskSendKeys()">
|
||||||
<input id="DeskClip" style="" type="button" value="Clipboard" onkeypress="return false" onkeydown="return false" onclick="showDeskClip()">
|
<input id="DeskClip" style="" type="button" value="Clipboard" onkeypress="return false" onkeydown="return false" onclick="showDeskClip()">
|
||||||
@ -2706,8 +2708,8 @@
|
|||||||
x += "<div id=agins_windows>To add a new computer to device group \"" + EscapeHtml(mesh.name) + "\", download the mesh agent and install it the computer to manage. This agent has server and mesh information embedded within it.<br /><br />";
|
x += "<div id=agins_windows>To add a new computer to device group \"" + EscapeHtml(mesh.name) + "\", download the mesh agent and install it the computer to manage. This agent has server and mesh information embedded within it.<br /><br />";
|
||||||
//x += addHtmlValue('Mesh Agent', '<a id=aginsw32lnk href="meshagents?id=3&meshid=' + meshid.split('/')[2] + '&installflags=0" rel="noreferrer noopener" target="_blank" title="32bit version of the MeshAgent">Windows (.exe)</a>');
|
//x += addHtmlValue('Mesh Agent', '<a id=aginsw32lnk href="meshagents?id=3&meshid=' + meshid.split('/')[2] + '&installflags=0" rel="noreferrer noopener" target="_blank" title="32bit version of the MeshAgent">Windows (.exe)</a>');
|
||||||
//x += addHtmlValue('Mesh Agent', '<a id=aginsw64lnk href="meshagents?id=4&meshid=' + meshid.split('/')[2] + '&installflags=0" rel="noreferrer noopener" target="_blank" title="64bit version of the MeshAgent">Windows x64 (.exe)</a>');
|
//x += addHtmlValue('Mesh Agent', '<a id=aginsw64lnk href="meshagents?id=4&meshid=' + meshid.split('/')[2] + '&installflags=0" rel="noreferrer noopener" target="_blank" title="64bit version of the MeshAgent">Windows x64 (.exe)</a>');
|
||||||
x += addHtmlValue('Mesh Agent', '<a id=aginsw32lnk style=cursor:pointer onclick=fileDownload("meshagents?id=3&meshid=' + meshid.split('/')[2] + '&installflags=","MeshAgent-' + meshfilename + '.exe",1) title="32bit version of the MeshAgent">Windows (.exe)</a>');
|
x += addHtmlValue('Mesh Agent', '<a id=aginsw32lnk style=cursor:pointer onclick=fileDownload("meshagents?id=3&meshid=' + meshid.split('/')[2] + '&installflags=","MeshAgent-' + meshfilename + '.exe",1) title="32bit version of the MeshAgent">Windows (.exe)</a> <img src=images/link4.png height=10 width=10 title="Copy 32bit agent URL to clipboard" style=cursor:pointer onclick=copyAgentUrl("meshagents?id=3&meshid=' + meshid.split('/')[2] + '&installflags=")>');
|
||||||
x += addHtmlValue('Mesh Agent', '<a id=aginsw64lnk style=cursor:pointer onclick=fileDownload("meshagents?id=4&meshid=' + meshid.split('/')[2] + '&installflags=","MeshAgent-' + meshfilename + '.exe",1) title="64bit version of the MeshAgent">Windows x64 (.exe)</a>');
|
x += addHtmlValue('Mesh Agent', '<a id=aginsw64lnk style=cursor:pointer onclick=fileDownload("meshagents?id=4&meshid=' + meshid.split('/')[2] + '&installflags=","MeshAgent-' + meshfilename + '.exe",1) title="64bit version of the MeshAgent">Windows x64 (.exe)</a> <img src=images/link4.png height=10 width=10 title="Copy 64bit agent URL to clipboard" style=cursor:pointer onclick=copyAgentUrl("meshagents?id=4&meshid=' + meshid.split('/')[2] + '&installflags=")>');
|
||||||
if (debugmode > 0) { x += addHtmlValue('Settings File', '<a id=aginswmshlnk href="meshsettings?id=' + meshid.split('/')[2] + '&installflags=0" rel="noreferrer noopener" target="_blank">' + EscapeHtml(mesh.name) + ' settings (.msh)</a>'); }
|
if (debugmode > 0) { x += addHtmlValue('Settings File', '<a id=aginswmshlnk href="meshsettings?id=' + meshid.split('/')[2] + '&installflags=0" rel="noreferrer noopener" target="_blank">' + EscapeHtml(mesh.name) + ' settings (.msh)</a>'); }
|
||||||
x += "</div>";
|
x += "</div>";
|
||||||
|
|
||||||
@ -2773,6 +2775,14 @@
|
|||||||
addAgentToMeshClick();
|
addAgentToMeshClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function copyAgentUrl(url) {
|
||||||
|
var servername = serverinfo.name;
|
||||||
|
if ((servername.indexOf('.') == -1) || ((features & 2) != 0)) { servername = window.location.hostname; } // If the server name is not set or it's in LAN-only mode, use the URL hostname as server name.
|
||||||
|
var domainUrlNoSlash = domainUrl.substring(0, domainUrl.length - 1);
|
||||||
|
var portStr = (serverinfo.port == 443) ? '' : (":" + serverinfo.port);
|
||||||
|
navigator.clipboard.writeText("http://" + servername + portStr + domainUrl + url + Q('aginsType').value);
|
||||||
|
}
|
||||||
|
|
||||||
function fileDownload(path, name, appendFlag) {
|
function fileDownload(path, name, appendFlag) {
|
||||||
var xdr = null, flag = '';
|
var xdr = null, flag = '';
|
||||||
if (appendFlag == 1) {
|
if (appendFlag == 1) {
|
||||||
@ -4778,10 +4788,22 @@
|
|||||||
}
|
}
|
||||||
} else if (ks == 6) { // WIN+R
|
} else if (ks == 6) { // WIN+R
|
||||||
if (desktop.contype == 2) {
|
if (desktop.contype == 2) {
|
||||||
desktop.m.sendkey([[0xffe7, 1], [0x72, 1], [0x72, 0], [0xffe7, 0]]); // Intel AMT: Meta-left down, 'l' press, 'l' release, Meta-left release
|
desktop.m.sendkey([[0xffe7,1],[0x72,1],[0x72,0],[0xffe7,0]]); // Intel AMT: Meta-left down, 'r' press, 'r' release, Meta-left release
|
||||||
} else {
|
} else {
|
||||||
desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN, 0x5B], [desktop.m.KeyAction.DOWN, 82], [desktop.m.KeyAction.UP, 82], [desktop.m.KeyAction.EXUP, 0x5B]]); // MeshAgent: L-Winkey press, 'R' press, 'R' release, L-Winkey release
|
desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN, 0x5B], [desktop.m.KeyAction.DOWN, 82], [desktop.m.KeyAction.UP, 82], [desktop.m.KeyAction.EXUP, 0x5B]]); // MeshAgent: L-Winkey press, 'R' press, 'R' release, L-Winkey release
|
||||||
}
|
}
|
||||||
|
} else if (ks == 7) { // ALT-F4
|
||||||
|
if (desktop.contype == 2) {
|
||||||
|
desktop.m.sendkey([[0xffe9,1],[0xffc1,1],[0xffc1,0],[0xffe9,0]]); // Intel AMT: Alt down, 'F4' press, 'F4' release, Alt release
|
||||||
|
} else {
|
||||||
|
desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN, 18], [desktop.m.KeyAction.DOWN, 115], [desktop.m.KeyAction.UP, 115], [desktop.m.KeyAction.EXUP, 18]]); // MeshAgent: Alt press, 'F4' press, 'F4' release, Alt release
|
||||||
|
}
|
||||||
|
} else if (ks == 8) { // CTRL-W
|
||||||
|
if (desktop.contype == 2) {
|
||||||
|
desktop.m.sendkey([[0xffe3,1],[0x77,1],[0x77,0],[0xffe3,0]]); // Intel AMT: Ctrl down, 'w' press, 'w' release, Ctrl release
|
||||||
|
} else {
|
||||||
|
desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN, 17], [desktop.m.KeyAction.DOWN, 87], [desktop.m.KeyAction.UP, 87], [desktop.m.KeyAction.EXUP, 17]]); // MeshAgent: Ctrl press, 'W' press, 'W' release, Ctrl release
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -242,7 +242,6 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
|||||||
obj.agentStats = {
|
obj.agentStats = {
|
||||||
createMeshAgentCount: 0,
|
createMeshAgentCount: 0,
|
||||||
agentClose: 0,
|
agentClose: 0,
|
||||||
agentTcpClose: 0,
|
|
||||||
agentBinaryUpdate: 0,
|
agentBinaryUpdate: 0,
|
||||||
coreIsStableCount: 0,
|
coreIsStableCount: 0,
|
||||||
verifiedAgentConnectionCount: 0,
|
verifiedAgentConnectionCount: 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user