feat: add xterm frontend ui

This commit is contained in:
Aarnav Tale
2025-05-31 12:56:20 -04:00
parent 55eacb59e9
commit cb32637938
9 changed files with 325 additions and 16 deletions
+17 -3
View File
@@ -143,22 +143,36 @@ export class SSHMultiplexer {
this.sshInput.write(encodedFrame);
},
onClose: (_, ws) => {
onClose: async (_, ws) => {
const sessionId = ws.raw;
if (sessionId && this.connections.has(sessionId)) {
const session = this.connections.get(sessionId);
if (session) {
await dispatchCommand(this.control, {
op: 'ssh_term',
payload: {
sessionId,
},
});
session.connected = false;
this.connections.delete(sessionId);
}
}
},
onError: (event, ws) => {
onError: async (event, ws) => {
const sessionId = ws.raw;
if (sessionId && this.connections.has(sessionId)) {
const session = this.connections.get(sessionId);
if (session) {
await dispatchCommand(this.control, {
op: 'ssh_term',
payload: {
sessionId,
},
});
session.connected = false;
this.connections.delete(sessionId);
}
@@ -191,7 +205,7 @@ export class SSHMultiplexer {
op: 'ssh_frame',
payload: {
channel: frame.channel,
data: frame.payload,
frame: frame.payload,
},
});
});