Import queue progress #87
@@ -6,6 +6,7 @@ import {
|
|||||||
} from "../actions/fileops.actions";
|
} from "../actions/fileops.actions";
|
||||||
import "react-loader-spinner/dist/loader/css/react-spinner-loader.css";
|
import "react-loader-spinner/dist/loader/css/react-spinner-loader.css";
|
||||||
import Loader from "react-loader-spinner";
|
import Loader from "react-loader-spinner";
|
||||||
|
import { isUndefined } from "lodash";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
matches?: unknown;
|
matches?: unknown;
|
||||||
@@ -35,6 +36,10 @@ export const Import = (props: IProps): ReactElement => {
|
|||||||
const failedImportJobCount = useSelector(
|
const failedImportJobCount = useSelector(
|
||||||
(state: RootState) => state.fileOps.failedImportJobCount,
|
(state: RootState) => state.fileOps.failedImportJobCount,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const lastQueueJob = useSelector(
|
||||||
|
(state: RootState) => state.fileOps.lastQueueJob,
|
||||||
|
);
|
||||||
const libraryQueueImportStatus = useSelector(
|
const libraryQueueImportStatus = useSelector(
|
||||||
(state: RootState) => state.fileOps.IMSCallInProgress,
|
(state: RootState) => state.fileOps.IMSCallInProgress,
|
||||||
);
|
);
|
||||||
@@ -55,12 +60,12 @@ export const Import = (props: IProps): ReactElement => {
|
|||||||
}, [isImportQueuePaused]);
|
}, [isImportQueuePaused]);
|
||||||
const pauseIconText = (
|
const pauseIconText = (
|
||||||
<>
|
<>
|
||||||
<i className="fa-solid fa-pause mr-2"></i> Pause Import
|
<i className="fa-solid fa-pause mr-2"></i> Pause
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
const playIconText = (
|
const playIconText = (
|
||||||
<>
|
<>
|
||||||
<i className="fa-solid fa-play mr-2"></i> Resume Import
|
<i className="fa-solid fa-play mr-2"></i> Resume
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
@@ -100,24 +105,39 @@ export const Import = (props: IProps): ReactElement => {
|
|||||||
<span>Start Import</span>
|
<span>Start Import</span>
|
||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
<div className="columns is-multiline is-half">
|
<table className="table">
|
||||||
<div className="column is-2 has-text-centered">
|
<thead>
|
||||||
<div className="box has-background-success-light">
|
<tr>
|
||||||
|
<th>
|
||||||
|
<abbr title="Position">Completed Jobs</abbr>
|
||||||
|
</th>
|
||||||
|
<th>Failed Jobs</th>
|
||||||
|
<th>
|
||||||
|
<abbr title="Played">Queue Controls</abbr>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
<div className="box has-background-success-light has-text-centered">
|
||||||
<span className="is-size-2 has-text-weight-bold">
|
<span className="is-size-2 has-text-weight-bold">
|
||||||
{libraryQueueResults}
|
{libraryQueueResults}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</th>
|
||||||
<div className="column is-2 has-text-centered">
|
<td>
|
||||||
<div className="box has-background-danger">
|
{!isUndefined(failedImportJobCount) && (
|
||||||
|
<div className="box has-background-danger has-text-centered">
|
||||||
<span className="is-size-2 has-text-weight-bold">
|
<span className="is-size-2 has-text-weight-bold">
|
||||||
{failedImportJobCount}
|
{failedImportJobCount}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
)}
|
||||||
|
</td>
|
||||||
|
|
||||||
<div className="column">
|
<td>
|
||||||
<div className="content">
|
|
||||||
<div className="control">
|
<div className="control">
|
||||||
<button
|
<button
|
||||||
className="button is-warning is-light"
|
className="button is-warning is-light"
|
||||||
@@ -126,9 +146,11 @@ export const Import = (props: IProps): ReactElement => {
|
|||||||
{!isImportQueuePaused ? pauseIconText : playIconText}
|
{!isImportQueuePaused ? pauseIconText : playIconText}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
</tbody>
|
||||||
|
</table>
|
||||||
|
Imported <span className="has-text-weight-bold">{lastQueueJob}</span>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ const initialState = {
|
|||||||
libraryComics: [],
|
libraryComics: [],
|
||||||
volumes: [],
|
volumes: [],
|
||||||
librarySearchResultsFormatted: [],
|
librarySearchResultsFormatted: [],
|
||||||
|
lastQueueJob: "",
|
||||||
librarySearchResultCount: 0,
|
librarySearchResultCount: 0,
|
||||||
failedJobCount: 0,
|
failedJobCount: 0,
|
||||||
libraryQueueResults: [],
|
libraryQueueResults: [],
|
||||||
@@ -163,6 +164,7 @@ function fileOpsReducer(state = initialState, action) {
|
|||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
librarySearchResultCount: action.completedJobCount,
|
librarySearchResultCount: action.completedJobCount,
|
||||||
|
lastQueueJob: action.importResult.rawFileDetails.name,
|
||||||
recentComics: [...state.recentComics, action.importResult],
|
recentComics: [...state.recentComics, action.importResult],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user