Show Indexer Status on Indexer Table

This commit is contained in:
Qstick
2021-02-11 21:54:00 -05:00
parent a41ae141cd
commit 56d5356f1e
10 changed files with 174 additions and 3 deletions

View File

@@ -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

View 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);

View 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;