From 78aa4d58d214e279e54e7baa58464febbfccedd9 Mon Sep 17 00:00:00 2001 From: Riccardo Crippa Date: Tue, 29 Apr 2025 15:18:49 +0200 Subject: [PATCH] adding notification on Maintenance mode. --- server/model/monitor.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 08d666b78..c056d86da 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1266,6 +1266,9 @@ class Monitor extends BeanModel { // UP -> MAINTENANCE = not important return isFirstBeat || (previousBeatStatus === MAINTENANCE && currentBeatStatus === DOWN) || + (previousBeatStatus === MAINTENANCE && currentBeatStatus === UP) || + (previousBeatStatus === UP && currentBeatStatus === MAINTENANCE) || + (previousBeatStatus === DOWN && currentBeatStatus === MAINTENANCE) || (previousBeatStatus === UP && currentBeatStatus === DOWN) || (previousBeatStatus === DOWN && currentBeatStatus === UP) || (previousBeatStatus === PENDING && currentBeatStatus === DOWN); @@ -1285,8 +1288,10 @@ class Monitor extends BeanModel { let text; if (bean.status === UP) { text = "✅ Up"; - } else { + } else if(bean.status === DOWN) { text = "🔴 Down"; + } else if(bean.status === MAINTENANCE) { + text = "🔴 Maintenance"; } let msg = `[${monitor.name}] [${text}] ${bean.msg}`;