From 9bdb8522f94505800309813d4417e8af5eb6a0a9 Mon Sep 17 00:00:00 2001 From: Riccardo Crippa Date: Tue, 29 Apr 2025 15:34:57 +0200 Subject: [PATCH 01/10] Notification on Maintenance Mode From 60b9b397b1d9c6acffd8776b7ed295371d88a66d Mon Sep 17 00:00:00 2001 From: Riccardo Crippa Date: Tue, 29 Apr 2025 15:18:49 +0200 Subject: [PATCH 02/10] 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 58decbcba..4f7d6e152 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1265,6 +1265,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); @@ -1284,8 +1287,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}`; From 459d34c6bc8d185b3eaa8b3210691b857db72d88 Mon Sep 17 00:00:00 2001 From: Riccardo Crippa Date: Tue, 29 Apr 2025 15:27:29 +0200 Subject: [PATCH 03/10] update maintenance icon on notification. --- server/model/monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 4f7d6e152..9afd1ec55 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1290,7 +1290,7 @@ class Monitor extends BeanModel { } else if(bean.status === DOWN) { text = "🔴 Down"; } else if(bean.status === MAINTENANCE) { - text = "🔴 Maintenance"; + text = "🟦 Maintenance"; } let msg = `[${monitor.name}] [${text}] ${bean.msg}`; From 4b2978dfb036f7a6a96fe65580f771b62e5a1592 Mon Sep 17 00:00:00 2001 From: Riccardo Crippa Date: Tue, 29 Apr 2025 15:32:33 +0200 Subject: [PATCH 04/10] update isImportantForNotification comment. --- server/model/monitor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 9afd1ec55..f1b1b57cb 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1259,10 +1259,10 @@ class Monitor extends BeanModel { // DOWN -> DOWN = not important // * DOWN -> UP = important // MAINTENANCE -> MAINTENANCE = not important - // MAINTENANCE -> UP = not important + // * MAINTENANCE -> UP = important // * MAINTENANCE -> DOWN = important - // DOWN -> MAINTENANCE = not important - // UP -> MAINTENANCE = not important + // * DOWN -> MAINTENANCE = important + // * UP -> MAINTENANCE = important return isFirstBeat || (previousBeatStatus === MAINTENANCE && currentBeatStatus === DOWN) || (previousBeatStatus === MAINTENANCE && currentBeatStatus === UP) || From 326a996a4851b02ee92182ac55ee93349d5aad78 Mon Sep 17 00:00:00 2001 From: Riccardo Crippa Date: Tue, 29 Apr 2025 15:55:02 +0200 Subject: [PATCH 05/10] fix linting. --- server/model/monitor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index f1b1b57cb..8c3969b69 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1287,9 +1287,9 @@ class Monitor extends BeanModel { let text; if (bean.status === UP) { text = "✅ Up"; - } else if(bean.status === DOWN) { + } else if (bean.status === DOWN) { text = "🔴 Down"; - } else if(bean.status === MAINTENANCE) { + } else if (bean.status === MAINTENANCE) { text = "🟦 Maintenance"; } From ab06bf7a52406a8ff6e2b0ce74755def2e6774c6 Mon Sep 17 00:00:00 2001 From: Riccardo Crippa Date: Wed, 30 Apr 2025 07:23:43 +0200 Subject: [PATCH 06/10] change maintenance icon from blue square to blue circle. --- server/model/monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 8c3969b69..b632cb8c6 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1290,7 +1290,7 @@ class Monitor extends BeanModel { } else if (bean.status === DOWN) { text = "🔴 Down"; } else if (bean.status === MAINTENANCE) { - text = "🟦 Maintenance"; + text = "🔵 Maintenance"; } let msg = `[${monitor.name}] [${text}] ${bean.msg}`; From 9cbbed4bbedead66bda2f883f68cca30e9dd9580 Mon Sep 17 00:00:00 2001 From: Riccardo Crippa Date: Sat, 3 May 2025 11:53:14 +0200 Subject: [PATCH 07/10] change Maintenance notification text. --- server/model/monitor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index b632cb8c6..0e86c4a19 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1270,6 +1270,7 @@ class Monitor extends BeanModel { (previousBeatStatus === DOWN && currentBeatStatus === MAINTENANCE) || (previousBeatStatus === UP && currentBeatStatus === DOWN) || (previousBeatStatus === DOWN && currentBeatStatus === UP) || + (previousBeatStatus === PENDING && currentBeatStatus === MAINTENANCE) || (previousBeatStatus === PENDING && currentBeatStatus === DOWN); } @@ -1290,7 +1291,7 @@ class Monitor extends BeanModel { } else if (bean.status === DOWN) { text = "🔴 Down"; } else if (bean.status === MAINTENANCE) { - text = "🔵 Maintenance"; + text = "Under Maintenance"; } let msg = `[${monitor.name}] [${text}] ${bean.msg}`; From 483477389c89957cbcfafa6be6862df8883ddde6 Mon Sep 17 00:00:00 2001 From: Riccardo Crippa Date: Mon, 5 May 2025 07:44:03 +0200 Subject: [PATCH 08/10] Revert "change Maintenance notification text." This reverts commit 9cbbed4bbedead66bda2f883f68cca30e9dd9580. --- server/model/monitor.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index 0e86c4a19..b632cb8c6 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1270,7 +1270,6 @@ class Monitor extends BeanModel { (previousBeatStatus === DOWN && currentBeatStatus === MAINTENANCE) || (previousBeatStatus === UP && currentBeatStatus === DOWN) || (previousBeatStatus === DOWN && currentBeatStatus === UP) || - (previousBeatStatus === PENDING && currentBeatStatus === MAINTENANCE) || (previousBeatStatus === PENDING && currentBeatStatus === DOWN); } @@ -1291,7 +1290,7 @@ class Monitor extends BeanModel { } else if (bean.status === DOWN) { text = "🔴 Down"; } else if (bean.status === MAINTENANCE) { - text = "Under Maintenance"; + text = "🔵 Maintenance"; } let msg = `[${monitor.name}] [${text}] ${bean.msg}`; From f5c10dd848b67e716c9439c5447b2241212aaafc Mon Sep 17 00:00:00 2001 From: Riccardo Crippa Date: Mon, 5 May 2025 07:57:53 +0200 Subject: [PATCH 09/10] change Maintenance text. --- server/model/monitor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/model/monitor.js b/server/model/monitor.js index b632cb8c6..06b0e54c4 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1290,7 +1290,7 @@ class Monitor extends BeanModel { } else if (bean.status === DOWN) { text = "🔴 Down"; } else if (bean.status === MAINTENANCE) { - text = "🔵 Maintenance"; + text = "🔵 In Maintenance"; } let msg = `[${monitor.name}] [${text}] ${bean.msg}`; From fcd903e17440fa94b1ea9a17cf4f85e62928e568 Mon Sep 17 00:00:00 2001 From: Riccardo Crippa Date: Mon, 5 May 2025 11:55:33 +0200 Subject: [PATCH 10/10] adding PENDING -> MAINTENANCE as important for notification. --- server/model/monitor.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/model/monitor.js b/server/model/monitor.js index 06b0e54c4..ffdebde87 100644 --- a/server/model/monitor.js +++ b/server/model/monitor.js @@ -1255,6 +1255,7 @@ class Monitor extends BeanModel { // PENDING -> PENDING = not important // * PENDING -> DOWN = important // PENDING -> UP = not important + // PENDING -> MAINTENANCE = important // DOWN -> PENDING = this case not exists // DOWN -> DOWN = not important // * DOWN -> UP = important @@ -1270,6 +1271,7 @@ class Monitor extends BeanModel { (previousBeatStatus === DOWN && currentBeatStatus === MAINTENANCE) || (previousBeatStatus === UP && currentBeatStatus === DOWN) || (previousBeatStatus === DOWN && currentBeatStatus === UP) || + (previousBeatStatus === PENDING && currentBeatStatus === MAINTENANCE) || (previousBeatStatus === PENDING && currentBeatStatus === DOWN); }