mirror of
https://github.com/louislam/dockge.git
synced 2025-08-09 22:07:49 +02:00
Close terminal if there is no clients (#60)
* Close terminal if there is no clients connecting * Only enable * Join the terminal only if it is managed by Dockge * Done
This commit is contained in:
@ -298,7 +298,7 @@ export class Stack {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
log.debug("getStack", "Skip FS operations");
|
||||
//log.debug("getStack", "Skip FS operations");
|
||||
}
|
||||
|
||||
let stack : Stack;
|
||||
@ -374,12 +374,21 @@ export class Stack {
|
||||
async joinCombinedTerminal(socket: DockgeSocket) {
|
||||
const terminalName = getCombinedTerminalName(this.name);
|
||||
const terminal = Terminal.getOrCreateTerminal(this.server, terminalName, "docker", [ "compose", "logs", "-f", "--tail", "100" ], this.path);
|
||||
terminal.enableKeepAlive = true;
|
||||
terminal.rows = COMBINED_TERMINAL_ROWS;
|
||||
terminal.cols = COMBINED_TERMINAL_COLS;
|
||||
terminal.join(socket);
|
||||
terminal.start();
|
||||
}
|
||||
|
||||
async leaveCombinedTerminal(socket: DockgeSocket) {
|
||||
const terminalName = getCombinedTerminalName(this.name);
|
||||
const terminal = Terminal.getTerminal(terminalName);
|
||||
if (terminal) {
|
||||
terminal.leave(socket);
|
||||
}
|
||||
}
|
||||
|
||||
async joinContainerTerminal(socket: DockgeSocket, serviceName: string, shell : string = "sh", index: number = 0) {
|
||||
const terminalName = getContainerExecTerminalName(this.name, serviceName, index);
|
||||
let terminal = Terminal.getTerminal(terminalName);
|
||||
|
Reference in New Issue
Block a user