Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.
Closed
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ You will find a configuration file named `config.json` in the `src/assets` direc
"colorblind": "#d62c13"
}
},
// Severity value used for days where no incidents occurred
"dayDefaultSeverity": 1,
// Backup color in case an unmapped severity value has been found
"unknownColor": "lightsteelblue",
// A short text to be displayed above the components
Expand Down
3 changes: 2 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ The following table explains all settings available in the configuration file. E
| dateFormat | The format to use for dates displayed. | Format | "YYYY-MM-DD HH:mm:ss z" |
| longDateFormat | Long format for dates, including day names. | Format | "dddd, Do MMMM YYYY, HH:mm:ss z" |
| severities | Maps severities to colors to use. | Object | see below |
| dayDefaultSeverity | Severity value used for days where no incidents occured | Number | 1
| unknownColor | Color to use for unknown severity values. | Color | "lightsteelblue" |
| aboutText | Short text that appears in the "About" section. | String | empty |
| maintenancePreviewDays | Number of days in the future to check for maintenance events. | number | 30 |
| maintenancePreviewDays | Number of days in the future to check for maintenance events. | Number | 30 |

The `severities` map contains one entry for each severity level specified in the API server. The default configuration included in the template file looks like this:

Expand Down
5 changes: 5 additions & 0 deletions src/app/app-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Config {
dateFormat: string = "YYYY-MM-DD HH:mm:ss z";
longDateFormat: string = "dddd, Do MMMM YYYY, HH:mm:ss z";
severities: Map<string, Severity> = new Map();
dayDefaultSeverity: number = 1;
unknownColor: string = "lightsteelblue";
aboutText: string = "";
maintenancePreviewDays: number = 30;
Expand Down Expand Up @@ -78,6 +79,10 @@ export class AppConfigService {
return this.config.severities;
}

get dayDefaultSeverity(): number {
return this.config.dayDefaultSeverity;
}

get unknownColor(): string {
return this.config.unknownColor;
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export class DataService {
this.components.forEach((component, componentId) => {
// Create daily data for each component
for (const [day, incidents] of this.incidentsByDay) {
const dailyData = new DailyStatus(day);
const dailyData = new DailyStatus(day, this.config.dayDefaultSeverity);
for (const incident of incidents) {
// Check if the incident affects this component
const affectingImpacts = incident[1].affects?.filter(c => c.reference === componentId) ?? [];
Expand All @@ -224,7 +224,7 @@ export class DataService {
const statusList = this.componentStatusByDay.get(component);
if (!statusList) {
// TODO Error properly
console.log("Found a component with missing daily status list?");
console.error("Found a component with missing daily status list?");
return;
}
let daysWithIncidents = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/app/management-view/management-view.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class ManagementViewComponent implements OnInit{
async ngOnInit(): Promise<void> {
this.security.checkAuth().subscribe(async response => {
if (!response.isAuthenticated) {
console.log(`Unauthenticated, potential error: ${response.errorMessage}`);
console.error(`Unauthenticated, potential error: ${response.errorMessage}`);
this.router.navigate([""]);
}
this.userData = this.security.userData;
Expand Down
6 changes: 4 additions & 2 deletions src/app/model/daily-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ export class DailyStatus {
private _topLevelIncident?: [IncidentId, Incident] = undefined;
private _topLevelImpact?: Impact = undefined;

private _severity: number = 0;
// We use a severity value of 1 as default. It is returned when no incidents have been
// added to this day.
private _severity: number = 1;

constructor(day: ShortDayString | Dayjs) {
constructor(day: ShortDayString | Dayjs, defaultSeverity: number) {
if (day instanceof dayjs) {
this.day = day.format(SHORT_DAY_FORMAT);
} else {
Expand Down
1 change: 1 addition & 0 deletions src/assets/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"colorblind": "#d62c13"
}
},
"dayDefaultSeverity": 1,
"unknownColor": "lightsteelblue",
"aboutText": "This is the status page for the SCS project. It displays incidents impacting any of the important components of this SCS stack.",
"maintenancePreviewDays": 30
Expand Down
1 change: 1 addition & 0 deletions src/assets/config.tmpl.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"colorblind": "#d62c13"
}
},
"dayDefaultSeverity": 1,
"unknownColor": "lightsteelblue",
"aboutText": "${STATUS_PAGE_WEB_ABOUT_TEXT}",
"maintenancePreviewDays": ${STATUS_PAGE_WEB_MAINTENANCE_PREVIEW_DAYS}
Expand Down