mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-21 21:33:18 +01:00
Removes dead containers correctly
This commit is contained in:
@@ -40,7 +40,17 @@ export const useContainerStore = defineStore("container", () => {
|
|||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
// es.addEventListener("container-die", (e) => store.dispatch("UPDATE_CONTAINER", JSON.parse(e.data)), false);
|
es.addEventListener(
|
||||||
|
"container-die",
|
||||||
|
(e) => {
|
||||||
|
const event = JSON.parse((e as MessageEvent).data) as { actorId: string };
|
||||||
|
const container = allContainersById.value[event.actorId];
|
||||||
|
if (container) {
|
||||||
|
container.state = "dead";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
const currentContainer = (id: Ref<string>) => computed(() => allContainersById.value[id.value]);
|
const currentContainer = (id: Ref<string>) => computed(() => allContainersById.value[id.value]);
|
||||||
const appendActiveContainer = ({ id }: Container) => activeContainerIds.value.push(id);
|
const appendActiveContainer = ({ id }: Container) => activeContainerIds.value.push(id);
|
||||||
|
|||||||
2
assets/types/Container.d.ts
vendored
2
assets/types/Container.d.ts
vendored
@@ -3,8 +3,8 @@ export interface Container {
|
|||||||
readonly created: number;
|
readonly created: number;
|
||||||
readonly image: string;
|
readonly image: string;
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
readonly state: "created" | "running" | "exited" | "dead" | "paused" | "restarting";
|
|
||||||
readonly status: string;
|
readonly status: string;
|
||||||
|
state: "created" | "running" | "exited" | "dead" | "paused" | "restarting";
|
||||||
stat?: ContainerStat;
|
stat?: ContainerStat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user