mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-03-05 00:44:46 +00:00
Fix slow response status messages auto show up now
This commit is contained in:
parent
6c0aaaab7e
commit
06c22eb336
2 changed files with 22 additions and 6 deletions
|
@ -1192,13 +1192,9 @@ let needSetup = false;
|
||||||
|
|
||||||
let count;
|
let count;
|
||||||
if (monitorID == null) {
|
if (monitorID == null) {
|
||||||
count = await R.count("heartbeat", "important = 1");
|
count = await R.count("heartbeat", "important = 1 OR ping_important = 1");
|
||||||
count += await R.count("heartbeat", "ping_important = 1");
|
|
||||||
} else {
|
} else {
|
||||||
count = await R.count("heartbeat", "monitor_id = ? AND important = 1", [
|
count = await R.count("heartbeat", "monitor_id = ? AND (important = 1 OR ping_important = 1)", [
|
||||||
monitorID,
|
|
||||||
]);
|
|
||||||
count += await R.count("heartbeat", "monitor_id = ? AND ping_important = 1", [
|
|
||||||
monitorID,
|
monitorID,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,6 +205,26 @@ export default {
|
||||||
|
|
||||||
this.emitter.emit("newImportantHeartbeat", data);
|
this.emitter.emit("newImportantHeartbeat", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.pingImportant) {
|
||||||
|
|
||||||
|
// TODO Do we want slow response toast messages?
|
||||||
|
// if (this.monitorList[data.monitorID] !== undefined) {
|
||||||
|
// if (data.pingStatus === SLOW) {
|
||||||
|
// toast.error(`[${this.monitorList[data.monitorID].name}] [SLOW] ${data.pingMsg}`, {
|
||||||
|
// timeout: getToastErrorTimeout(),
|
||||||
|
// });
|
||||||
|
// } else if (data.pingStatus === NOMINAL) {
|
||||||
|
// toast.success(`[${this.monitorList[data.monitorID].name}] [NOMINAL] ${data.pingMsg}`, {
|
||||||
|
// timeout: getToastSuccessTimeout(),
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// toast(`[${this.monitorList[data.monitorID].name}] ${data.pingMsg}`);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
this.emitter.emit("newImportantHeartbeat", data);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("heartbeatList", (monitorID, data, overwrite = false) => {
|
socket.on("heartbeatList", (monitorID, data, overwrite = false) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue