History Improvements Round 1

This commit is contained in:
Qstick
2021-03-07 23:07:12 -05:00
parent 0fa526a1af
commit 9fab7d8328
54 changed files with 395 additions and 79 deletions

View File

@@ -70,6 +70,7 @@ import {
faLanguage as fasLanguage,
faLaptop as fasLaptop,
faLevelUpAlt as fasLevelUpAlt,
faLock as fasLock,
faMedkit as fasMedkit,
faMinus as fasMinus,
faPause as fasPause,
@@ -167,6 +168,7 @@ export const IN_CINEMAS = fasTicketAlt;
export const INFO = fasInfoCircle;
export const INTERACTIVE = fasUser;
export const KEYBOARD = farKeyboard;
export const LOCK = fasLock;
export const LOGOUT = fasSignOutAlt;
export const MEDIA_INFO = farFileInvoice;
export const MISSING = fasExclamationTriangle;

View File

@@ -12,7 +12,7 @@ function HistoryDetails(props) {
data
} = props;
if (eventType === 'indexerQuery') {
if (eventType === 'indexerQuery' || eventType === 'indexerRss') {
const {
query,
queryResults,
@@ -65,7 +65,8 @@ function HistoryDetails(props) {
if (eventType === 'releaseGrabbed') {
const {
source
source,
title
} = data;
return (
@@ -82,7 +83,32 @@ function HistoryDetails(props) {
!!data &&
<DescriptionListItem
title={'Source'}
data={source}
data={source ? source : '-'}
/>
}
{
!!data &&
<DescriptionListItem
title={'Title'}
data={title ? title : '-'}
/>
}
</DescriptionList>
);
}
if (eventType === 'indexerAuth') {
return (
<DescriptionList
descriptionClassName={styles.description}
title={translate('Auth')}
>
{
!!indexer &&
<DescriptionListItem
title={translate('Indexer')}
data={indexer.name}
/>
}
</DescriptionList>

View File

@@ -16,6 +16,12 @@ function getHeaderTitle(eventType) {
switch (eventType) {
case 'indexerQuery':
return 'Indexer Query';
case 'releaseGrabbed':
return 'Release Grabbed';
case 'indexerAuth':
return 'Indexer Auth Attempt';
case 'indexerRss':
return 'Indexer Rss Query';
default:
return 'Unknown';
}

View File

@@ -27,7 +27,7 @@ class History extends Component {
error,
isMoviesFetching,
isMoviesPopulated,
moviesError,
indexersError,
items,
columns,
selectedFilterKey,
@@ -40,7 +40,7 @@ class History extends Component {
const isFetchingAny = isFetching || isMoviesFetching;
const isAllPopulated = isPopulated && (isMoviesPopulated || !items.length);
const hasError = error || moviesError;
const hasError = error || indexersError;
return (
<PageContent title={translate('History')}>
@@ -140,7 +140,7 @@ History.propTypes = {
error: PropTypes.object,
isMoviesFetching: PropTypes.bool.isRequired,
isMoviesPopulated: PropTypes.bool.isRequired,
moviesError: PropTypes.object,
indexersError: PropTypes.object,
items: PropTypes.arrayOf(PropTypes.object).isRequired,
columns: PropTypes.arrayOf(PropTypes.object).isRequired,
selectedFilterKey: PropTypes.string.isRequired,

View File

@@ -15,7 +15,7 @@ function createMapStateToProps() {
return {
isMoviesFetching: indexers.isFetching,
isMoviesPopulated: indexers.isPopulated,
moviesError: indexers.error,
indexersError: indexers.error,
...history
};
}

View File

@@ -11,6 +11,10 @@ function getIconName(eventType) {
return icons.SEARCH;
case 'releaseGrabbed':
return icons.DOWNLOAD;
case 'indexerAuth':
return icons.LOCK;
case 'indexerRss':
return icons.RSS;
default:
return icons.UNKNOWN;
}
@@ -31,6 +35,10 @@ function getTooltip(eventType, data, indexer) {
return `Query "${data.query}" sent to ${indexer.name}`;
case 'releaseGrabbed':
return `Release grabbed from ${indexer.name}`;
case 'indexerAuth':
return `Auth attempted for ${indexer.name}`;
case 'indexerRss':
return `RSS query for ${indexer.name}`;
default:
return 'Unknown event';
}

View File

@@ -16,6 +16,18 @@
width: 110px;
}
.categories {
composes: cell from '~Components/Table/Cells/TableRowCell.css';
width: 110px;
}
.source {
composes: cell from '~Components/Table/Cells/TableRowCell.css';
width: 110px;
}
.details {
composes: cell from '~Components/Table/Cells/TableRowCell.css';

View File

@@ -117,6 +117,21 @@ class HistoryRow extends Component {
);
}
if (name === 'categories') {
return (
<TableRowCell
key={name}
className={styles.indexer}
>
{
data.categories ?
data.categories :
null
}
</TableRowCell>
);
}
if (name === 'successful') {
return (
<TableRowCell
@@ -128,6 +143,21 @@ class HistoryRow extends Component {
);
}
if (name === 'source') {
return (
<TableRowCell
key={name}
className={styles.indexer}
>
{
data.source ?
data.source :
null
}
</TableRowCell>
);
}
if (name === 'elapsedTime') {
return (
<TableRowCell

View File

@@ -61,6 +61,8 @@
.downloadLink {
composes: link from '~Components/Link/Link.css';
margin: 0 2px;
width: 22px;
color: $textColor;
}

View File

@@ -220,6 +220,13 @@ class SearchIndexRow extends Component {
title={'Grab'}
to={downloadUrl}
/>
<IconButton
className={styles.downloadLink}
name={icons.SAVE}
title={'Save'}
to={downloadUrl}
/>
</VirtualTableRowCell>
);
}

View File

@@ -46,6 +46,12 @@ export const defaultState = {
isSortable: false,
isVisible: true
},
{
name: 'categories',
label: 'Categories',
isSortable: false,
isVisible: true
},
{
name: 'date',
label: translate('Date'),
@@ -56,7 +62,13 @@ export const defaultState = {
name: 'successful',
label: 'Successful',
isSortable: false,
isVisible: true
isVisible: false
},
{
name: 'source',
label: 'Source',
isSortable: false,
isVisible: false
},
{
name: 'elapsedTime',