diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/services/UptimeKuma.vue | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/components/services/UptimeKuma.vue b/src/components/services/UptimeKuma.vue index 5117a05..55232af 100644 --- a/src/components/services/UptimeKuma.vue +++ b/src/components/services/UptimeKuma.vue | |||
@@ -85,9 +85,22 @@ export default { | |||
85 | if (this.incident.incident) { | 85 | if (this.incident.incident) { |
86 | return this.incident.incident.title; | 86 | return this.incident.incident.title; |
87 | } | 87 | } |
88 | return this.pageStatus == "warn" | 88 | |
89 | ? "Partially Degraded Service" | 89 | let message = ""; |
90 | : "All Systems Operational"; | 90 | switch (this.pageStatus) { |
91 | case "good": | ||
92 | message = "All Systems Operational"; | ||
93 | break; | ||
94 | case "warn": | ||
95 | message = "Partially Degraded Service"; | ||
96 | break; | ||
97 | case "bad": | ||
98 | message = "Degraded Service"; | ||
99 | break; | ||
100 | default: | ||
101 | message = "Unknown service status"; | ||
102 | } | ||
103 | return message; | ||
91 | }, | 104 | }, |
92 | uptime: function () { | 105 | uptime: function () { |
93 | if (!this.heartbeat) { | 106 | if (!this.heartbeat) { |
@@ -105,12 +118,13 @@ export default { | |||
105 | }, | 118 | }, |
106 | methods: { | 119 | methods: { |
107 | fetchStatus: function () { | 120 | fetchStatus: function () { |
108 | this.fetch(`/api/status-page/${this.dashboard}?cachebust=${Date.now()}`) | 121 | const now = Date.now() |
122 | this.fetch(`/api/status-page/${this.dashboard}?cachebust=${now}`) | ||
109 | .catch((e) => console.error(e)) | 123 | .catch((e) => console.error(e)) |
110 | .then((resp) => (this.incident = resp)); | 124 | .then((resp) => (this.incident = resp)); |
111 | 125 | ||
112 | this.fetch( | 126 | this.fetch( |
113 | `/api/status-page/heartbeat/${this.dashboard}?cachebust=${Date.now()}` | 127 | `/api/status-page/heartbeat/${this.dashboard}?cachebust=${now}` |
114 | ) | 128 | ) |
115 | .catch((e) => console.error(e)) | 129 | .catch((e) => console.error(e)) |
116 | .then((resp) => (this.heartbeat = resp)); | 130 | .then((resp) => (this.heartbeat = resp)); |