mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-22 22:34:53 -04:00
Misc History Improvements
This commit is contained in:
@@ -47,6 +47,15 @@ function MovieIndexSortMenu(props) {
|
||||
{translate('Added')}
|
||||
</SortMenuItem>
|
||||
|
||||
<SortMenuItem
|
||||
name="priority"
|
||||
sortKey={sortKey}
|
||||
sortDirection={sortDirection}
|
||||
onPress={onSortSelect}
|
||||
>
|
||||
{'Priority'}
|
||||
</SortMenuItem>
|
||||
|
||||
<SortMenuItem
|
||||
name="protocol"
|
||||
sortKey={sortKey}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
.progress {
|
||||
composes: container from '~Components/ProgressBar.css';
|
||||
|
||||
border-radius: 0;
|
||||
background-color: #5b5b5b;
|
||||
color: $white;
|
||||
transition: width 200ms ease;
|
||||
}
|
||||
|
||||
.progressBar {
|
||||
composes: progressBar from '~Components/ProgressBar.css';
|
||||
|
||||
transition: width 200ms ease;
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import ProgressBar from 'Components/ProgressBar';
|
||||
import { sizes } from 'Helpers/Props';
|
||||
import getProgressBarKind from 'Utilities/Movie/getProgressBarKind';
|
||||
import getQueueStatusText from 'Utilities/Movie/getQueueStatusText';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import styles from './MovieIndexProgressBar.css';
|
||||
|
||||
function MovieIndexProgressBar(props) {
|
||||
const {
|
||||
monitored,
|
||||
status,
|
||||
hasFile,
|
||||
isAvailable,
|
||||
posterWidth,
|
||||
detailedProgressBar,
|
||||
queueStatus,
|
||||
queueState
|
||||
} = props;
|
||||
|
||||
const progress = 100;
|
||||
const queueStatusText = getQueueStatusText(queueStatus, queueState);
|
||||
let movieStatus = (status === 'released' && hasFile) ? 'downloaded' : status;
|
||||
|
||||
if (movieStatus === 'deleted') {
|
||||
movieStatus = 'Missing';
|
||||
|
||||
if (hasFile) {
|
||||
movieStatus = 'Downloaded';
|
||||
}
|
||||
} else if (hasFile) {
|
||||
movieStatus = 'Downloaded';
|
||||
} else if (isAvailable && !hasFile) {
|
||||
movieStatus = 'Missing';
|
||||
} else {
|
||||
movieStatus = 'NotAvailable';
|
||||
}
|
||||
|
||||
return (
|
||||
<ProgressBar
|
||||
className={styles.progressBar}
|
||||
containerClassName={styles.progress}
|
||||
progress={progress}
|
||||
kind={getProgressBarKind(status, monitored, hasFile, isAvailable, queueStatusText)}
|
||||
size={detailedProgressBar ? sizes.MEDIUM : sizes.SMALL}
|
||||
showText={detailedProgressBar}
|
||||
width={posterWidth}
|
||||
text={(queueStatusText) ? queueStatusText : translate(movieStatus)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
MovieIndexProgressBar.propTypes = {
|
||||
monitored: PropTypes.bool.isRequired,
|
||||
hasFile: PropTypes.bool.isRequired,
|
||||
isAvailable: PropTypes.bool.isRequired,
|
||||
status: PropTypes.string.isRequired,
|
||||
posterWidth: PropTypes.number.isRequired,
|
||||
detailedProgressBar: PropTypes.bool.isRequired,
|
||||
queueStatus: PropTypes.string,
|
||||
queueState: PropTypes.string
|
||||
};
|
||||
|
||||
export default MovieIndexProgressBar;
|
||||
@@ -0,0 +1,9 @@
|
||||
.status {
|
||||
composes: cell from '~Components/Table/Cells/TableRowCell.css';
|
||||
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.statusIcon {
|
||||
width: 20px !important;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import Icon from 'Components/Icon';
|
||||
import VirtualTableRowCell from 'Components/Table/Cells/TableRowCell';
|
||||
import { icons } from 'Helpers/Props';
|
||||
import styles from './IndexerStatusCell.css';
|
||||
|
||||
function IndexerStatusCell(props) {
|
||||
const {
|
||||
className,
|
||||
enabled,
|
||||
component: Component,
|
||||
...otherProps
|
||||
} = props;
|
||||
|
||||
return (
|
||||
<Component
|
||||
className={className}
|
||||
{...otherProps}
|
||||
>
|
||||
{
|
||||
!enabled &&
|
||||
<Icon
|
||||
className={styles.statusIcon}
|
||||
name={icons.BLACKLIST}
|
||||
title={enabled ? 'Indexer is Enabled' : 'Indexer is Disabled'}
|
||||
/>
|
||||
}
|
||||
</Component>
|
||||
);
|
||||
}
|
||||
|
||||
IndexerStatusCell.propTypes = {
|
||||
className: PropTypes.string.isRequired,
|
||||
enabled: PropTypes.bool.isRequired,
|
||||
component: PropTypes.elementType
|
||||
};
|
||||
|
||||
IndexerStatusCell.defaultProps = {
|
||||
className: styles.status,
|
||||
component: VirtualTableRowCell
|
||||
};
|
||||
|
||||
export default IndexerStatusCell;
|
||||
@@ -10,6 +10,7 @@
|
||||
flex: 4 0 110px;
|
||||
}
|
||||
|
||||
.priority,
|
||||
.privacy,
|
||||
.protocol {
|
||||
composes: headerCell from '~Components/Table/VirtualTableHeaderCell.css';
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
flex: 4 0 110px;
|
||||
}
|
||||
|
||||
.priority,
|
||||
.protocol,
|
||||
.privacy {
|
||||
composes: cell;
|
||||
|
||||
@@ -5,11 +5,14 @@ import IconButton from 'Components/Link/IconButton';
|
||||
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
|
||||
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
||||
import VirtualTableSelectCell from 'Components/Table/Cells/VirtualTableSelectCell';
|
||||
import { icons, kinds } from 'Helpers/Props';
|
||||
import TagListConnector from 'Components/TagListConnector';
|
||||
import { icons } from 'Helpers/Props';
|
||||
import DeleteIndexerModal from 'Indexer/Delete/DeleteIndexerModal';
|
||||
import EditIndexerModalConnector from 'Settings/Indexers/Indexers/EditIndexerModalConnector';
|
||||
import titleCase from 'Utilities/String/titleCase';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import CapabilitiesLabel from './CapabilitiesLabel';
|
||||
import IndexerStatusCell from './IndexerStatusCell';
|
||||
import ProtocolLabel from './ProtocolLabel';
|
||||
import styles from './MovieIndexRow.css';
|
||||
|
||||
@@ -61,8 +64,10 @@ class MovieIndexRow extends Component {
|
||||
enableRss,
|
||||
enableAutomaticSearch,
|
||||
enableInteractiveSearch,
|
||||
tags,
|
||||
protocol,
|
||||
privacy,
|
||||
priority,
|
||||
added,
|
||||
capabilities,
|
||||
columns,
|
||||
@@ -103,28 +108,13 @@ class MovieIndexRow extends Component {
|
||||
|
||||
if (column.name === 'status') {
|
||||
return (
|
||||
<VirtualTableRowCell
|
||||
<IndexerStatusCell
|
||||
key={column.name}
|
||||
className={styles[column.name]}
|
||||
>
|
||||
{
|
||||
enableRss || enableAutomaticSearch || enableInteractiveSearch ?
|
||||
<Label kind={kinds.SUCCESS}>
|
||||
{'Enabled'}
|
||||
</Label>:
|
||||
null
|
||||
}
|
||||
{
|
||||
!enableRss && !enableAutomaticSearch && !enableInteractiveSearch ?
|
||||
<Label
|
||||
kind={kinds.DISABLED}
|
||||
outline={true}
|
||||
>
|
||||
{translate('Disabled')}
|
||||
</Label> :
|
||||
null
|
||||
}
|
||||
</VirtualTableRowCell>
|
||||
enabled={enableRss || enableAutomaticSearch || enableInteractiveSearch}
|
||||
status={status}
|
||||
component={VirtualTableRowCell}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -146,12 +136,23 @@ class MovieIndexRow extends Component {
|
||||
className={styles[column.name]}
|
||||
>
|
||||
<Label>
|
||||
{privacy}
|
||||
{titleCase(privacy)}
|
||||
</Label>
|
||||
</VirtualTableRowCell>
|
||||
);
|
||||
}
|
||||
|
||||
if (column.name === 'priority') {
|
||||
return (
|
||||
<VirtualTableRowCell
|
||||
key={column.name}
|
||||
className={styles[column.name]}
|
||||
>
|
||||
{priority}
|
||||
</VirtualTableRowCell>
|
||||
);
|
||||
}
|
||||
|
||||
if (column.name === 'protocol') {
|
||||
return (
|
||||
<VirtualTableRowCell
|
||||
@@ -189,6 +190,19 @@ class MovieIndexRow extends Component {
|
||||
);
|
||||
}
|
||||
|
||||
if (column.name === 'tags') {
|
||||
return (
|
||||
<VirtualTableRowCell
|
||||
key={column.name}
|
||||
className={styles[column.name]}
|
||||
>
|
||||
<TagListConnector
|
||||
tags={tags}
|
||||
/>
|
||||
</VirtualTableRowCell>
|
||||
);
|
||||
}
|
||||
|
||||
if (column.name === 'actions') {
|
||||
return (
|
||||
<VirtualTableRowCell
|
||||
@@ -234,6 +248,7 @@ MovieIndexRow.propTypes = {
|
||||
id: PropTypes.number.isRequired,
|
||||
protocol: PropTypes.string.isRequired,
|
||||
privacy: PropTypes.string.isRequired,
|
||||
priority: PropTypes.number.isRequired,
|
||||
name: PropTypes.string.isRequired,
|
||||
enableRss: PropTypes.bool.isRequired,
|
||||
enableAutomaticSearch: PropTypes.bool.isRequired,
|
||||
@@ -248,4 +263,8 @@ MovieIndexRow.propTypes = {
|
||||
onSelectedChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
MovieIndexRow.defaultProps = {
|
||||
tags: []
|
||||
};
|
||||
|
||||
export default MovieIndexRow;
|
||||
|
||||
Reference in New Issue
Block a user