1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 13:23:07 +01:00
Files
dozzle/assets/models/Stack.ts

31 lines
708 B
TypeScript

import { Container } from "@/models/Container";
export class Stack {
constructor(
public readonly name: string,
public readonly containers: Container[],
public readonly services: Service[],
) {
for (const service of services) {
service.stack = this;
}
}
get updatedAt() {
return this.containers.map((c) => c.created).reduce((acc, date) => (date > acc ? date : acc), new Date(0));
}
}
export class Service {
constructor(
public readonly name: string,
public readonly containers: Container[],
) {}
stack?: Stack;
get updatedAt() {
return this.containers.map((c) => c.created).reduce((acc, date) => (date > acc ? date : acc), new Date(0));
}
}