Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/AppRoot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
}
Expand Down
5 changes: 5 additions & 0 deletions src/components/ServiceRow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
<div class="bg-white/10"></div>
`;
}
const notices = this.noticesForDay(day);
if (notices.length === 0) {
return html`
Expand Down
3 changes: 3 additions & 0 deletions src/models/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@ 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(
id: string,
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;
}

Expand Down
11 changes: 10 additions & 1 deletion src/models/ServiceGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down