-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
45 lines (34 loc) · 1.45 KB
/
config.js
File metadata and controls
45 lines (34 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// CONFIGURATION FOR MAINTENANCE MESSAGE
// Options:
// 1 = SERVER UNREACHABLE
// 2 = SCHEDULED MAINTENANCE
// 3 = UNSCHEDULED MAINTENANCE
// 4 = UNSCHEDULED DOWNTIME
const maintenanceScenarioNumber = 1;
// Downtime start time in UTC: "YYYY-MM-DD HH:MM"
const manualDowntimeStartString = "2025-03-14 17:17";
// Predicted downtime
const predictedDowntime = "~30-60 minutes";
// Reason for maintenance
const maintenanceReason = "Dust removal";
// Color setting for reason text
const reasonTextColor = "#f06";
// === DO NOT EDIT BELOW THIS LINE ===
// Mapping numbers to scenario names
const maintenanceScenarioMap = {
1: "SERVER_UNREACHABLE",
2: "SCHEDULED_MAINTENANCE",
3: "UNSCHEDULED_MAINTENANCE",
4: "UNSCHEDULED_DOWNTIME"
};
// Get the selected scenario name
const maintenanceScenario = maintenanceScenarioMap[maintenanceScenarioNumber] || "SERVER_UNREACHABLE"; // Default to SERVER_UNREACHABLE if invalid number
// Function to convert "YYYY-MM-DD HH:MM" to Date object (UTC)
function parseUtcDateTime(dateTimeString) {
const [datePart, timePart] = dateTimeString.split(" ");
const [year, month, day] = datePart.split("-").map(Number);
const [hour, minute] = timePart.split(":").map(Number);
return new Date(Date.UTC(year, month - 1, day, hour, minute)); // Month is zero-based
}
// Convert the string to a Date object
const manualDowntimeStart = parseUtcDateTime(manualDowntimeStartString);