From 765f354c514dbb7847e9b6d1231c8685b18f700b Mon Sep 17 00:00:00 2001 From: Bogdan Date: Sat, 5 Aug 2023 14:06:05 +0300 Subject: [PATCH] New: Add test all action for apps and download clients to status health --- frontend/src/System/Status/Health/Health.js | 24 ++++++++++++++++++- .../System/Status/Health/HealthConnector.js | 10 +++++++- .../Applications/ApplicationFactory.cs | 5 ++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/frontend/src/System/Status/Health/Health.js b/frontend/src/System/Status/Health/Health.js index 2747050f6..b4e9a2ed8 100644 --- a/frontend/src/System/Status/Health/Health.js +++ b/frontend/src/System/Status/Health/Health.js @@ -42,6 +42,25 @@ function getInternalLink(source) { function getTestLink(source, props) { switch (source) { + case 'ApplicationStatusCheck': + case 'ApplicationLongTermStatusCheck': + return ( + + ); + case 'DownloadClientStatusCheck': + return ( + + ); case 'IndexerStatusCheck': case 'IndexerLongTermStatusCheck': return ( @@ -52,7 +71,6 @@ function getTestLink(source, props) { onPress={props.dispatchTestAllIndexers} /> ); - default: break; } @@ -188,7 +206,11 @@ Health.propTypes = { isFetching: PropTypes.bool.isRequired, isPopulated: PropTypes.bool.isRequired, items: PropTypes.array.isRequired, + isTestingAllApplications: PropTypes.bool.isRequired, + isTestingAllDownloadClients: PropTypes.bool.isRequired, isTestingAllIndexers: PropTypes.bool.isRequired, + dispatchTestAllApplications: PropTypes.func.isRequired, + dispatchTestAllDownloadClients: PropTypes.func.isRequired, dispatchTestAllIndexers: PropTypes.func.isRequired }; diff --git a/frontend/src/System/Status/Health/HealthConnector.js b/frontend/src/System/Status/Health/HealthConnector.js index 885faa424..687e0ed87 100644 --- a/frontend/src/System/Status/Health/HealthConnector.js +++ b/frontend/src/System/Status/Health/HealthConnector.js @@ -3,6 +3,8 @@ import React, { Component } from 'react'; import { connect } from 'react-redux'; import { createSelector } from 'reselect'; import { testAllIndexers } from 'Store/Actions/indexerActions'; +import { testAllApplications } from 'Store/Actions/Settings/applications'; +import { testAllDownloadClients } from 'Store/Actions/Settings/downloadClients'; import { fetchHealth } from 'Store/Actions/systemActions'; import createHealthCheckSelector from 'Store/Selectors/createHealthCheckSelector'; import Health from './Health'; @@ -11,8 +13,10 @@ function createMapStateToProps() { return createSelector( createHealthCheckSelector(), (state) => state.system.health, + (state) => state.settings.applications.isTestingAll, + (state) => state.settings.downloadClients.isTestingAll, (state) => state.indexers.isTestingAll, - (items, health, isTestingAllIndexers) => { + (items, health, isTestingAllApplications, isTestingAllDownloadClients, isTestingAllIndexers) => { const { isFetching, isPopulated @@ -22,6 +26,8 @@ function createMapStateToProps() { isFetching, isPopulated, items, + isTestingAllApplications, + isTestingAllDownloadClients, isTestingAllIndexers }; } @@ -30,6 +36,8 @@ function createMapStateToProps() { const mapDispatchToProps = { dispatchFetchHealth: fetchHealth, + dispatchTestAllApplications: testAllApplications, + dispatchTestAllDownloadClients: testAllDownloadClients, dispatchTestAllIndexers: testAllIndexers }; diff --git a/src/NzbDrone.Core/Applications/ApplicationFactory.cs b/src/NzbDrone.Core/Applications/ApplicationFactory.cs index 1366744b4..492710fee 100644 --- a/src/NzbDrone.Core/Applications/ApplicationFactory.cs +++ b/src/NzbDrone.Core/Applications/ApplicationFactory.cs @@ -42,6 +42,11 @@ namespace NzbDrone.Core.Applications return enabledClients.ToList(); } + protected override List Active() + { + return base.Active().Where(c => c.Enable).ToList(); + } + private IEnumerable FilterBlockedApplications(IEnumerable applications) { var blockedApplications = _applicationStatusService.GetBlockedProviders().ToDictionary(v => v.ProviderId, v => v);