This commit is contained in:
Riccardo Crippa 2025-05-18 20:36:06 +00:00 committed by GitHub
commit dce69c5804
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1256,18 +1256,23 @@ class Monitor extends BeanModel {
// PENDING -> PENDING = not important // PENDING -> PENDING = not important
// * PENDING -> DOWN = important // * PENDING -> DOWN = important
// PENDING -> UP = not important // PENDING -> UP = not important
// PENDING -> MAINTENANCE = important
// DOWN -> PENDING = this case not exists // DOWN -> PENDING = this case not exists
// DOWN -> DOWN = not important // DOWN -> DOWN = not important
// * DOWN -> UP = important // * DOWN -> UP = important
// MAINTENANCE -> MAINTENANCE = not important // MAINTENANCE -> MAINTENANCE = not important
// MAINTENANCE -> UP = not important // * MAINTENANCE -> UP = important
// * MAINTENANCE -> DOWN = important // * MAINTENANCE -> DOWN = important
// DOWN -> MAINTENANCE = not important // * DOWN -> MAINTENANCE = important
// UP -> MAINTENANCE = not important // * UP -> MAINTENANCE = important
return isFirstBeat || return isFirstBeat ||
(previousBeatStatus === MAINTENANCE && currentBeatStatus === DOWN) || (previousBeatStatus === MAINTENANCE && currentBeatStatus === DOWN) ||
(previousBeatStatus === MAINTENANCE && currentBeatStatus === UP) ||
(previousBeatStatus === UP && currentBeatStatus === MAINTENANCE) ||
(previousBeatStatus === DOWN && currentBeatStatus === MAINTENANCE) ||
(previousBeatStatus === UP && currentBeatStatus === DOWN) || (previousBeatStatus === UP && currentBeatStatus === DOWN) ||
(previousBeatStatus === DOWN && currentBeatStatus === UP) || (previousBeatStatus === DOWN && currentBeatStatus === UP) ||
(previousBeatStatus === PENDING && currentBeatStatus === MAINTENANCE) ||
(previousBeatStatus === PENDING && currentBeatStatus === DOWN); (previousBeatStatus === PENDING && currentBeatStatus === DOWN);
} }
@ -1285,8 +1290,10 @@ class Monitor extends BeanModel {
let text; let text;
if (bean.status === UP) { if (bean.status === UP) {
text = "✅ Up"; text = "✅ Up";
} else { } else if (bean.status === DOWN) {
text = "🔴 Down"; text = "🔴 Down";
} else if (bean.status === MAINTENANCE) {
text = "🔵 In Maintenance";
} }
let msg = `[${monitor.name}] [${text}] ${bean.msg}`; let msg = `[${monitor.name}] [${text}] ${bean.msg}`;