mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Show Indexer Status on Indexer Table
This commit is contained in:
@@ -6,6 +6,7 @@ import * as history from './historyActions';
|
||||
import * as indexers from './indexerActions';
|
||||
import * as indexerIndex from './indexerIndexActions';
|
||||
import * as indexerStats from './indexerStatsActions';
|
||||
import * as indexerStatus from './indexerStatusActions';
|
||||
import * as movies from './movieActions';
|
||||
import * as oAuth from './oAuthActions';
|
||||
import * as paths from './pathActions';
|
||||
@@ -29,6 +30,7 @@ export default [
|
||||
indexers,
|
||||
indexerIndex,
|
||||
indexerStats,
|
||||
indexerStatus,
|
||||
settings,
|
||||
system,
|
||||
tags
|
||||
|
46
frontend/src/Store/Actions/indexerStatusActions.js
Normal file
46
frontend/src/Store/Actions/indexerStatusActions.js
Normal file
@@ -0,0 +1,46 @@
|
||||
import { createThunk, handleThunks } from 'Store/thunks';
|
||||
import createFetchHandler from './Creators/createFetchHandler';
|
||||
import createHandleActions from './Creators/createHandleActions';
|
||||
|
||||
//
|
||||
// Variables
|
||||
|
||||
export const section = 'indexerStatus';
|
||||
|
||||
//
|
||||
// State
|
||||
|
||||
export const defaultState = {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: null,
|
||||
items: [],
|
||||
|
||||
details: {
|
||||
isFetching: false,
|
||||
isPopulated: false,
|
||||
error: null,
|
||||
items: []
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
// Actions Types
|
||||
|
||||
export const FETCH_INDEXER_STATUS = 'indexerStatus/fetchIndexerStatus';
|
||||
|
||||
//
|
||||
// Action Creators
|
||||
|
||||
export const fetchIndexerStatus = createThunk(FETCH_INDEXER_STATUS);
|
||||
|
||||
//
|
||||
// Action Handlers
|
||||
|
||||
export const actionHandlers = handleThunks({
|
||||
[FETCH_INDEXER_STATUS]: createFetchHandler(section, '/indexerStatus')
|
||||
});
|
||||
|
||||
//
|
||||
// Reducers
|
||||
export const reducers = createHandleActions({}, defaultState, section);
|
14
frontend/src/Store/Selectors/createIndexerStatusSelector.js
Normal file
14
frontend/src/Store/Selectors/createIndexerStatusSelector.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import _ from 'lodash';
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
function createIndexerStatusSelector() {
|
||||
return createSelector(
|
||||
(state, { indexerId }) => indexerId,
|
||||
(state) => state.indexerStatus.items,
|
||||
(indexerId, indexerStatus) => {
|
||||
return _.find(indexerStatus, { indexerId });
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export default createIndexerStatusSelector;
|
Reference in New Issue
Block a user