From f2efebf7d94cf707e0594dabcbb5a6394e32622c Mon Sep 17 00:00:00 2001 From: Qstick Date: Wed, 7 Aug 2019 21:45:29 -0400 Subject: [PATCH] New: Option to send notification when a Health Check warning occurs closes #3253 --- .../EditNotificationModalContent.js | 32 ++++++++++++++++ .../Notifications/Notification.js | 15 +++++++- .../NotificationBaseFixture.cs | 7 ++++ .../135_health_issue_notification.cs | 15 ++++++++ src/NzbDrone.Core/Datastore/TableMapping.cs | 3 +- .../HealthCheck/HealthCheckFailedEvent.cs | 14 +++++++ .../HealthCheck/HealthCheckService.cs | 5 +++ .../Notifications/Boxcar/Boxcar.cs | 5 +++ .../CustomScript/CustomScript.cs | 14 +++++++ .../Notifications/Discord/Discord.cs | 17 +++++++++ .../Notifications/Email/Email.cs | 4 ++ .../Notifications/Gotify/Gotify.cs | 5 +++ .../Notifications/Growl/Growl.cs | 5 ++- .../Notifications/INotification.cs | 2 + src/NzbDrone.Core/Notifications/Join/Join.cs | 5 +++ .../MediaBrowser/MediaBrowser.cs | 7 ++++ .../Notifications/NotificationBase.cs | 8 ++++ .../Notifications/NotificationDefinition.cs | 5 ++- .../Notifications/NotificationFactory.cs | 7 ++++ .../Notifications/NotificationService.cs | 38 ++++++++++++++++++- .../Plex/HomeTheater/PlexClient.cs | 4 ++ .../Notifications/Prowl/Prowl.cs | 5 +++ .../Notifications/PushBullet/PushBullet.cs | 5 +++ .../Notifications/Pushover/Pushover.cs | 5 +++ .../Notifications/Slack/Slack.cs | 17 +++++++++ .../Notifications/Telegram/Telegram.cs | 5 +++ .../Notifications/Twitter/Twitter.cs | 5 +++ src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs | 5 +++ .../Notifications/NotificationResource.cs | 9 +++++ 29 files changed, 267 insertions(+), 6 deletions(-) create mode 100644 src/NzbDrone.Core/Datastore/Migration/135_health_issue_notification.cs create mode 100644 src/NzbDrone.Core/HealthCheck/HealthCheckFailedEvent.cs diff --git a/frontend/src/Settings/Notifications/Notifications/EditNotificationModalContent.js b/frontend/src/Settings/Notifications/Notifications/EditNotificationModalContent.js index 5c08e6622..4deb2e78c 100644 --- a/frontend/src/Settings/Notifications/Notifications/EditNotificationModalContent.js +++ b/frontend/src/Settings/Notifications/Notifications/EditNotificationModalContent.js @@ -42,10 +42,13 @@ function EditNotificationModalContent(props) { onDownload, onUpgrade, onRename, + onHealthIssue, supportsOnGrab, supportsOnDownload, supportsOnUpgrade, supportsOnRename, + supportsOnHealthIssue, + includeHealthWarnings, tags, fields, message @@ -147,6 +150,35 @@ function EditNotificationModalContent(props) { /> + + On Health Issue + + + + + { + onHealthIssue.value && + + Include Health Warnings + + + + } + Tags diff --git a/frontend/src/Settings/Notifications/Notifications/Notification.js b/frontend/src/Settings/Notifications/Notifications/Notification.js index 29c2b1465..ecea5b6db 100644 --- a/frontend/src/Settings/Notifications/Notifications/Notification.js +++ b/frontend/src/Settings/Notifications/Notifications/Notification.js @@ -58,10 +58,12 @@ class Notification extends Component { onDownload, onUpgrade, onRename, + onHealthIssue, supportsOnGrab, supportsOnDownload, supportsOnUpgrade, - supportsOnRename + supportsOnRename, + supportsOnHealthIssue } = this.props; return ( @@ -103,7 +105,14 @@ class Notification extends Component { } { - !onGrab && !onDownload && !onRename && + supportsOnHealthIssue && onHealthIssue && + + } + + { + !onGrab && !onDownload && !onRename && !onHealthIssue &&