Add Docker/Podman container management over SSH: container list with status, ports, CPU and memory; shell and live logs in terminal tabs; start, stop, restart and remove

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 22:11:26 +02:00
co-authored by Claude Opus 5.5
parent 039d89b9f7
commit 70a15eddbc
7 changed files with 322 additions and 7 deletions
+7 -3
View File
@@ -137,15 +137,19 @@ class SshManager {
const env = host.env ? Object.fromEntries(host.env.split('\n').filter(Boolean).map((l) => l.split('=').map((s) => s.trim()))) : undefined;
await new Promise((res, rej) => {
conn.shell({ term: 'xterm-256color', cols, rows }, { env }, (err, stream) => {
const pty = { term: 'xterm-256color', cols, rows };
const onStream = (err, stream) => {
if (err) return rej(err);
sess.stream = stream;
stream.on('data', (d) => send('data', d.toString('utf8')));
stream.stderr.on('data', (d) => send('data', d.toString('utf8')));
stream.on('close', () => conn.end());
if (host.startupCommand) stream.write(host.startupCommand + '\n');
if (host.startupCommand && !host.execCommand) stream.write(host.startupCommand + '\n');
res();
});
};
// execCommand: statt Login-Shell einen Befehl mit PTY starten (z. B. docker exec -it …)
if (host.execCommand) conn.exec(host.execCommand, { pty, env }, onStream);
else conn.shell(pty, { env }, onStream);
});
}