mirror of
https://github.com/bastienwirtz/homer.git
synced 2025-06-26 04:31:37 +02:00
Fix UptimeKuma status message when all sites are down #503
This commit is contained in:
parent
ae1b04d1c4
commit
5418c6291a
@ -207,7 +207,9 @@ export default {
|
|||||||
this.currentPage = window.location.hash.substring(1) || "default";
|
this.currentPage = window.location.hash.substring(1) || "default";
|
||||||
|
|
||||||
if (this.currentPage !== "default") {
|
if (this.currentPage !== "default") {
|
||||||
let pageConfig = await this.getConfig(`assets/${this.currentPage}.yml`);
|
let pageConfig = await this.getConfig(
|
||||||
|
`assets/${this.currentPage}.yml`
|
||||||
|
);
|
||||||
config = Object.assign(config, pageConfig);
|
config = Object.assign(config, pageConfig);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -85,9 +85,22 @@ export default {
|
|||||||
if (this.incident.incident) {
|
if (this.incident.incident) {
|
||||||
return this.incident.incident.title;
|
return this.incident.incident.title;
|
||||||
}
|
}
|
||||||
return this.pageStatus == "warn"
|
|
||||||
? "Partially Degraded Service"
|
let message = "";
|
||||||
: "All Systems Operational";
|
switch (this.pageStatus) {
|
||||||
|
case "good":
|
||||||
|
message = "All Systems Operational";
|
||||||
|
break;
|
||||||
|
case "warn":
|
||||||
|
message = "Partially Degraded Service";
|
||||||
|
break;
|
||||||
|
case "bad":
|
||||||
|
message = "Degraded Service";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
message = "Unknown service status";
|
||||||
|
}
|
||||||
|
return message;
|
||||||
},
|
},
|
||||||
uptime: function () {
|
uptime: function () {
|
||||||
if (!this.heartbeat) {
|
if (!this.heartbeat) {
|
||||||
@ -105,12 +118,13 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchStatus: function () {
|
fetchStatus: function () {
|
||||||
this.fetch(`/api/status-page/${this.dashboard}?cachebust=${Date.now()}`)
|
const now = Date.now()
|
||||||
|
this.fetch(`/api/status-page/${this.dashboard}?cachebust=${now}`)
|
||||||
.catch((e) => console.error(e))
|
.catch((e) => console.error(e))
|
||||||
.then((resp) => (this.incident = resp));
|
.then((resp) => (this.incident = resp));
|
||||||
|
|
||||||
this.fetch(
|
this.fetch(
|
||||||
`/api/status-page/heartbeat/${this.dashboard}?cachebust=${Date.now()}`
|
`/api/status-page/heartbeat/${this.dashboard}?cachebust=${now}`
|
||||||
)
|
)
|
||||||
.catch((e) => console.error(e))
|
.catch((e) => console.error(e))
|
||||||
.then((resp) => (this.heartbeat = resp));
|
.then((resp) => (this.heartbeat = resp));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user