mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-16 00:21:52 +08:00
Merge branch 'master' into 2.0.X
# Conflicts: # package-lock.json # server/database.js # server/util-server.js
This commit is contained in:
@@ -57,7 +57,8 @@ export default {
|
||||
message: "",
|
||||
errorMessage: "",
|
||||
currentPassword: "",
|
||||
}
|
||||
},
|
||||
faviconUpdateDebounce: null,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -186,16 +187,18 @@ export default {
|
||||
// Also toast
|
||||
if (data.important) {
|
||||
|
||||
if (data.status === 0) {
|
||||
toast.error(`[${this.monitorList[data.monitorID].name}] [DOWN] ${data.msg}`, {
|
||||
timeout: false,
|
||||
});
|
||||
} else if (data.status === 1) {
|
||||
toast.success(`[${this.monitorList[data.monitorID].name}] [Up] ${data.msg}`, {
|
||||
timeout: 20000,
|
||||
});
|
||||
} else {
|
||||
toast(`[${this.monitorList[data.monitorID].name}] ${data.msg}`);
|
||||
if (this.monitorList[data.monitorID] !== undefined) {
|
||||
if (data.status === 0) {
|
||||
toast.error(`[${this.monitorList[data.monitorID].name}] [DOWN] ${data.msg}`, {
|
||||
timeout: false,
|
||||
});
|
||||
} else if (data.status === 1) {
|
||||
toast.success(`[${this.monitorList[data.monitorID].name}] [Up] ${data.msg}`, {
|
||||
timeout: 20000,
|
||||
});
|
||||
} else {
|
||||
toast(`[${this.monitorList[data.monitorID].name}] ${data.msg}`);
|
||||
}
|
||||
}
|
||||
|
||||
if (! (data.monitorID in this.importantHeartbeatList)) {
|
||||
@@ -765,7 +768,12 @@ export default {
|
||||
// Update Badge
|
||||
"stats.down"(to, from) {
|
||||
if (to !== from) {
|
||||
favicon.badge(to);
|
||||
if (this.faviconUpdateDebounce != null) {
|
||||
clearTimeout(this.faviconUpdateDebounce);
|
||||
}
|
||||
this.faviconUpdateDebounce = setTimeout(() => {
|
||||
favicon.badge(to);
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user