mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-29 13:25:13 +02:00
Show Indexer Status on Indexer Table
This commit is contained in:
@@ -6,6 +6,8 @@ import * as commandNames from 'Commands/commandNames';
|
||||
import { executeCommand } from 'Store/Actions/commandActions';
|
||||
import createExecutingCommandsSelector from 'Store/Selectors/createExecutingCommandsSelector';
|
||||
import createIndexerSelector from 'Store/Selectors/createIndexerSelector';
|
||||
import createIndexerStatusSelector from 'Store/Selectors/createIndexerStatusSelector';
|
||||
import createUISettingsSelector from 'Store/Selectors/createUISettingsSelector';
|
||||
|
||||
function selectShowSearchAction() {
|
||||
return createSelector(
|
||||
@@ -19,12 +21,16 @@ function selectShowSearchAction() {
|
||||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
createIndexerSelector(),
|
||||
createIndexerStatusSelector(),
|
||||
selectShowSearchAction(),
|
||||
createExecutingCommandsSelector(),
|
||||
createUISettingsSelector(),
|
||||
(
|
||||
movie,
|
||||
status,
|
||||
showSearchAction,
|
||||
executingCommands
|
||||
executingCommands,
|
||||
uiSettings
|
||||
) => {
|
||||
|
||||
// If a movie is deleted this selector may fire before the parent
|
||||
@@ -32,6 +38,8 @@ function createMapStateToProps() {
|
||||
// we want to return early here and again in the render function to avoid
|
||||
// trying to show a movie that has no information available.
|
||||
|
||||
console.log(status);
|
||||
|
||||
if (!movie) {
|
||||
return {};
|
||||
}
|
||||
@@ -52,9 +60,12 @@ function createMapStateToProps() {
|
||||
|
||||
return {
|
||||
...movie,
|
||||
status,
|
||||
showSearchAction,
|
||||
isRefreshingMovie,
|
||||
isSearchingMovie
|
||||
isSearchingMovie,
|
||||
longDateFormat: uiSettings.longDateFormat,
|
||||
timeFormat: uiSettings.timeFormat
|
||||
};
|
||||
}
|
||||
);
|
||||
|
@@ -3,12 +3,16 @@ import React from 'react';
|
||||
import Icon from 'Components/Icon';
|
||||
import VirtualTableRowCell from 'Components/Table/Cells/TableRowCell';
|
||||
import { icons, kinds } from 'Helpers/Props';
|
||||
import formatDateTime from 'Utilities/Date/formatDateTime';
|
||||
import styles from './IndexerStatusCell.css';
|
||||
|
||||
function IndexerStatusCell(props) {
|
||||
const {
|
||||
className,
|
||||
enabled,
|
||||
status,
|
||||
longDateFormat,
|
||||
timeFormat,
|
||||
component: Component,
|
||||
...otherProps
|
||||
} = props;
|
||||
@@ -26,6 +30,15 @@ function IndexerStatusCell(props) {
|
||||
title={enabled ? 'Indexer is Enabled' : 'Indexer is Disabled'}
|
||||
/>
|
||||
}
|
||||
{
|
||||
status &&
|
||||
<Icon
|
||||
className={styles.statusIcon}
|
||||
kind={kinds.DANGER}
|
||||
name={icons.WARNING}
|
||||
title={`Indexer is Disabled due to failures until ${formatDateTime(status.disabledTill, longDateFormat, timeFormat)}`}
|
||||
/>
|
||||
}
|
||||
</Component>
|
||||
);
|
||||
}
|
||||
@@ -33,6 +46,9 @@ function IndexerStatusCell(props) {
|
||||
IndexerStatusCell.propTypes = {
|
||||
className: PropTypes.string.isRequired,
|
||||
enabled: PropTypes.bool.isRequired,
|
||||
status: PropTypes.object,
|
||||
longDateFormat: PropTypes.string.isRequired,
|
||||
timeFormat: PropTypes.string.isRequired,
|
||||
component: PropTypes.elementType
|
||||
};
|
||||
|
||||
|
@@ -68,9 +68,12 @@ class MovieIndexRow extends Component {
|
||||
protocol,
|
||||
privacy,
|
||||
priority,
|
||||
status,
|
||||
added,
|
||||
capabilities,
|
||||
columns,
|
||||
longDateFormat,
|
||||
timeFormat,
|
||||
isMovieEditorActive,
|
||||
isSelected,
|
||||
onSelectedChange
|
||||
@@ -113,6 +116,8 @@ class MovieIndexRow extends Component {
|
||||
className={styles[column.name]}
|
||||
enabled={enableRss || enableAutomaticSearch || enableInteractiveSearch}
|
||||
status={status}
|
||||
longDateFormat={longDateFormat}
|
||||
timeFormat={timeFormat}
|
||||
component={VirtualTableRowCell}
|
||||
/>
|
||||
);
|
||||
@@ -253,6 +258,7 @@ MovieIndexRow.propTypes = {
|
||||
enableRss: PropTypes.bool.isRequired,
|
||||
enableAutomaticSearch: PropTypes.bool.isRequired,
|
||||
enableInteractiveSearch: PropTypes.bool.isRequired,
|
||||
status: PropTypes.object,
|
||||
capabilities: PropTypes.object.isRequired,
|
||||
added: PropTypes.string.isRequired,
|
||||
tags: PropTypes.arrayOf(PropTypes.number).isRequired,
|
||||
@@ -260,7 +266,9 @@ MovieIndexRow.propTypes = {
|
||||
isSearchingMovie: PropTypes.bool.isRequired,
|
||||
isMovieEditorActive: PropTypes.bool.isRequired,
|
||||
isSelected: PropTypes.bool,
|
||||
onSelectedChange: PropTypes.func.isRequired
|
||||
onSelectedChange: PropTypes.func.isRequired,
|
||||
longDateFormat: PropTypes.string.isRequired,
|
||||
timeFormat: PropTypes.string.isRequired
|
||||
};
|
||||
|
||||
MovieIndexRow.defaultProps = {
|
||||
|
Reference in New Issue
Block a user