diff --git a/src/components/AppRoot.ts b/src/components/AppRoot.ts index 65ae8e8..885b593 100644 --- a/src/components/AppRoot.ts +++ b/src/components/AppRoot.ts @@ -142,6 +142,7 @@ export class AppRoot extends Component { return new Metric(m.id, m.name.default, m.suffix, data); }), ), + c.startDate === null ? null : new Date(c.startDate), c.showUptime, ); } diff --git a/src/components/ServiceRow.ts b/src/components/ServiceRow.ts index 3f3e960..5fea621 100644 --- a/src/components/ServiceRow.ts +++ b/src/components/ServiceRow.ts @@ -170,6 +170,11 @@ export class ServiceRow extends Component { const now = new Date(); const bars = Array.from({ length: 90 }, (_, i) => { const day = new Date(now.getTime() - (89 - i) * 86400000); + if ((this.service.started?.getTime() ?? 0) > day.getTime()) { + return html` +
+ `; + } const notices = this.noticesForDay(day); if (notices.length === 0) { return html` diff --git a/src/models/Service.ts b/src/models/Service.ts index 65204ce..6977300 100644 --- a/src/models/Service.ts +++ b/src/models/Service.ts @@ -6,6 +6,7 @@ export class Service { public readonly name: string; public readonly status: ServiceStatus; public readonly metrics: Metric[]; + public readonly started: Date | null; public readonly showUptime: boolean; public constructor( @@ -13,12 +14,14 @@ export class Service { name: string, status: ServiceStatus, metrics: Metric[], + started: Date | null, showUptime: boolean, ) { this.id = id; this.name = name; this.status = status; this.metrics = metrics; + this.started = started; this.showUptime = showUptime; } diff --git a/src/models/ServiceGroup.ts b/src/models/ServiceGroup.ts index 5a736b7..16e6a51 100644 --- a/src/models/ServiceGroup.ts +++ b/src/models/ServiceGroup.ts @@ -12,7 +12,16 @@ export class ServiceGroup extends Service { showUptime: boolean, isCollapsed: boolean, ) { - super(id, name, Services.mostSevere(children).status, [], showUptime); + super( + id, + name, + Services.mostSevere(children).status, + [], + Array.from(children).sort((a, b) => + (a.started?.getTime() ?? 0) - (b.started?.getTime() ?? 0) + )[0]?.started, + showUptime, + ); this.children = children; this.isCollapsed = isCollapsed; }