Fix slow response status messages auto show up now

This commit is contained in:
Stephen Papierski 2023-11-14 13:55:37 -07:00
parent 6c0aaaab7e
commit 06c22eb336
No known key found for this signature in database
2 changed files with 22 additions and 6 deletions

View file

@ -1192,13 +1192,9 @@ let needSetup = false;
let count;
if (monitorID == null) {
count = await R.count("heartbeat", "important = 1");
count += await R.count("heartbeat", "ping_important = 1");
count = await R.count("heartbeat", "important = 1 OR ping_important = 1");
} else {
count = await R.count("heartbeat", "monitor_id = ? AND important = 1", [
monitorID,
]);
count += await R.count("heartbeat", "monitor_id = ? AND ping_important = 1", [
count = await R.count("heartbeat", "monitor_id = ? AND (important = 1 OR ping_important = 1)", [
monitorID,
]);
}

View file

@ -205,6 +205,26 @@ export default {
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) => {