Add "docker compose down" (#122)

This commit is contained in:
Louis Lam
2023-11-21 18:17:11 +08:00
committed by GitHub
parent b7c6bbba67
commit e95ef66ca1
5 changed files with 50 additions and 0 deletions

View File

@ -187,6 +187,27 @@ export class DockerSocketHandler extends SocketHandler {
}
});
// down stack
socket.on("downStack", async (stackName : unknown, callback) => {
try {
checkLogin(socket);
if (typeof(stackName) !== "string") {
throw new ValidationError("Stack name must be a string");
}
const stack = Stack.getStack(server, stackName);
await stack.down(socket);
callback({
ok: true,
msg: "Downed"
});
server.sendStackList();
} catch (e) {
callbackError(e, callback);
}
});
// Services status
socket.on("serviceStatusList", async (stackName : unknown, callback) => {
try {