aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/services
diff options
context:
space:
mode:
authorBastien Wirtz <bastien.wirtz@gmail.com>2022-09-18 16:29:55 +0200
committerBastien Wirtz <bastien.wirtz@gmail.com>2022-09-18 16:30:32 +0200
commit5418c6291a39d27aeee471673adba742080e1ccb (patch)
tree177eb97c9aeb217231e3eafae29483a9936b41b2 /src/components/services
parentae1b04d1c4db540cead1dd10c458f720ae3ab99c (diff)
downloadhomer-5418c6291a39d27aeee471673adba742080e1ccb.tar.gz
homer-5418c6291a39d27aeee471673adba742080e1ccb.tar.zst
homer-5418c6291a39d27aeee471673adba742080e1ccb.zip
Fix UptimeKuma status message when all sites are down #503
Diffstat (limited to 'src/components/services')
-rw-r--r--src/components/services/UptimeKuma.vue24
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));