From a86aa4c5d3315a6cea59bd23d3dac9fca539bec1 Mon Sep 17 00:00:00 2001 From: The Dark <12370876+CheAle14@users.noreply.github.com> Date: Mon, 8 May 2023 02:57:14 +0100 Subject: [PATCH] New: On Health Restored notification (cherry picked from commit 5fdc8514da7c7ad98192f2ecb2415b3a7b5d0d05) --- .../Notifications/Notification.js | 24 +++++++++++++---- .../Notifications/NotificationEventItems.js | 15 ++++++++++- .../NotificationBaseFixture.cs | 7 +++++ .../032_health_restored_notification.cs | 14 ++++++++++ src/NzbDrone.Core/Datastore/TableMapping.cs | 1 + .../HealthCheck/HealthCheckRestoredEvent.cs | 16 ++++++++++++ .../HealthCheck/HealthCheckService.cs | 7 +++++ src/NzbDrone.Core/Localization/Core/en.json | 2 ++ .../Notifications/Apprise/Apprise.cs | 5 ++++ .../Notifications/Boxcar/Boxcar.cs | 5 ++++ .../CustomScript/CustomScript.cs | 15 +++++++++++ .../Notifications/Discord/Discord.cs | 23 ++++++++++++++++ .../Notifications/Email/Email.cs | 5 ++++ .../Notifications/Gotify/Gotify.cs | 5 ++++ .../Notifications/INotification.cs | 2 ++ src/NzbDrone.Core/Notifications/Join/Join.cs | 5 ++++ .../Notifications/Mailgun/Mailgun.cs | 5 ++++ .../Notifications/Notifiarr/Notifiarr.cs | 5 ++++ .../Notifications/NotificationBase.cs | 7 +++++ .../Notifications/NotificationDefinition.cs | 4 ++- .../Notifications/NotificationFactory.cs | 7 +++++ .../Notifications/NotificationService.cs | 26 +++++++++++++++++-- src/NzbDrone.Core/Notifications/Ntfy/Ntfy.cs | 5 ++++ .../Notifications/Prowl/Prowl.cs | 5 ++++ .../Notifications/PushBullet/PushBullet.cs | 5 ++++ .../Notifications/Pushover/Pushover.cs | 5 ++++ .../Notifications/SendGrid/SendGrid.cs | 5 ++++ .../Notifications/Simplepush/Simplepush.cs | 5 ++++ .../Notifications/Slack/Slack.cs | 17 ++++++++++++ .../Notifications/Telegram/Telegram.cs | 5 ++++ .../Notifications/Twitter/Twitter.cs | 5 ++++ .../Notifications/Webhook/Webhook.cs | 5 ++++ .../Notifications/Webhook/WebhookBase.cs | 13 ++++++++++ .../Notifications/Webhook/WebhookEventType.cs | 3 ++- .../Notifications/NotificationResource.cs | 6 +++++ 35 files changed, 279 insertions(+), 10 deletions(-) create mode 100644 src/NzbDrone.Core/Datastore/Migration/032_health_restored_notification.cs create mode 100644 src/NzbDrone.Core/HealthCheck/HealthCheckRestoredEvent.cs diff --git a/frontend/src/Settings/Notifications/Notifications/Notification.js b/frontend/src/Settings/Notifications/Notifications/Notification.js index 1331a7c8b..66021fd0d 100644 --- a/frontend/src/Settings/Notifications/Notifications/Notification.js +++ b/frontend/src/Settings/Notifications/Notifications/Notification.js @@ -57,9 +57,11 @@ class Notification extends Component { name, onGrab, onHealthIssue, + onHealthRestored, onApplicationUpdate, supportsOnGrab, supportsOnHealthIssue, + supportsOnHealthRestored, supportsOnApplicationUpdate } = this.props; @@ -74,17 +76,27 @@ class Notification extends Component { { - supportsOnGrab && onGrab && + supportsOnGrab && onGrab ? + : + null } { - supportsOnHealthIssue && onHealthIssue && + supportsOnHealthIssue && onHealthIssue ? + : + null + } + + { + supportsOnHealthRestored && onHealthRestored ? + : + null } { @@ -96,7 +108,7 @@ class Notification extends Component { } { - !onGrab && !onHealthIssue && !onApplicationUpdate ? + !onGrab && !onHealthIssue && !onHealthRestored && !onApplicationUpdate ?