refactor: add toggle for normal containers & stack

This commit is contained in:
Mauricio Siu
2024-12-25 02:51:44 -06:00
parent f672c429c4
commit da858e215d
3 changed files with 164 additions and 52 deletions

View File

@@ -54,7 +54,7 @@ export const setupDockerContainerLogsWebSocketServer = (
const client = new Client();
client
.once("ready", () => {
const baseCommand = `docker ${runType==="swarm"?"service":"container"} logs --timestamps --tail ${tail} ${
const baseCommand = `docker ${runType === "swarm" ? "service" : "container"} logs --timestamps --tail ${tail} ${
since === "all" ? "" : `--since ${since}`
} --follow ${containerId}`;
const escapedSearch = search ? search.replace(/'/g, "'\\''") : "";
@@ -98,7 +98,7 @@ export const setupDockerContainerLogsWebSocketServer = (
});
} else {
const shell = getShell();
const baseCommand = `docker ${runType==="swarm"?"service":"container"} logs --timestamps --tail ${tail} ${
const baseCommand = `docker ${runType === "swarm" ? "service" : "container"} logs --timestamps --tail ${tail} ${
since === "all" ? "" : `--since ${since}`
} --follow ${containerId}`;
const command = search