mirror of
https://github.com/louislam/dockge.git
synced 2025-08-18 12:48:54 +02:00
Console Improvements (#767)
This commit is contained in:
@@ -38,6 +38,11 @@ export class TerminalSocketHandler extends AgentSocketHandler {
|
||||
try {
|
||||
checkLogin(socket);
|
||||
|
||||
// Throw an error if console is not enabled
|
||||
if (!server.config.enableConsole) {
|
||||
throw new ValidationError("Console is not enabled.");
|
||||
}
|
||||
|
||||
// TODO: Reset the name here, force one main terminal for now
|
||||
terminalName = "console";
|
||||
|
||||
@@ -66,6 +71,18 @@ export class TerminalSocketHandler extends AgentSocketHandler {
|
||||
}
|
||||
});
|
||||
|
||||
// Check if MainTerminal is enabled
|
||||
agentSocket.on("checkMainTerminal", async (callback) => {
|
||||
try {
|
||||
checkLogin(socket);
|
||||
callbackResult({
|
||||
ok: server.config.enableConsole,
|
||||
}, callback);
|
||||
} catch (e) {
|
||||
callbackError(e, callback);
|
||||
}
|
||||
});
|
||||
|
||||
// Interactive Terminal for containers
|
||||
agentSocket.on("interactiveTerminal", async (stackName : unknown, serviceName : unknown, shell : unknown, callback) => {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user