mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
First working web-based SSH.
This commit is contained in:
parent
abbb6be431
commit
1b32966c76
8 changed files with 338 additions and 306 deletions
|
@ -6458,7 +6458,7 @@
|
|||
|
||||
// SSH link
|
||||
if ((((connectivity & 1) != 0) || (node.mtype == 3)) && (node.agent) && ((meshrights & 8) != 0) && ((features & 0x40000000) == 0) && (node.agent.id != 14)) {
|
||||
x += '<a href=# cmenu=altPortContextMenu id=sshLink onclick=p10ssh("' + node._id + '") title="' + "Launch web-based SSH session to this device" + '.">' + "Web-SSH" + '</a> ';
|
||||
x += '<a href=# id=sshLink onclick=p10ssh("' + node._id + '") title="' + "Launch web-based SSH session to this device" + '.">' + "Web-SSH" + '</a> ';
|
||||
}
|
||||
|
||||
// MQTT options
|
||||
|
|
|
@ -104,6 +104,8 @@
|
|||
resizeTimer = setTimeout(sendResize, 200);
|
||||
});
|
||||
//term.setOption('convertEol', true); // Consider \n to be \r\n, this should be taken care of by "termios"
|
||||
|
||||
connectButton();
|
||||
}
|
||||
|
||||
// Send the new terminal size to the agent
|
||||
|
@ -149,16 +151,9 @@
|
|||
if (data.data[0] == '{') {
|
||||
var json = JSON.parse(data.data);
|
||||
switch (json.action) {
|
||||
case 'connected': {
|
||||
state = 3;
|
||||
updateState();
|
||||
term.focus();
|
||||
break;
|
||||
}
|
||||
case 'autherror': {
|
||||
setDialogMode(2, "Authentication", 1, null, "Unable to authenticate.");
|
||||
break;
|
||||
}
|
||||
case 'connected': { state = 3; updateState(); term.focus(); break; }
|
||||
case 'autherror': { setDialogMode(2, "Authentication", 1, null, "Unable to authenticate."); break; }
|
||||
case 'sessionerror': { setDialogMode(2, "Session", 1, null, "Session expired."); break; }
|
||||
}
|
||||
} else if (data.data[0] == '~') {
|
||||
term.writeUtf8(data.data.substring(1));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue