|
|
@ -16,6 +16,13 @@ import FormLabel from 'Components/Form/FormLabel';
|
|
|
|
import FormInputGroup from 'Components/Form/FormInputGroup';
|
|
|
|
import FormInputGroup from 'Components/Form/FormInputGroup';
|
|
|
|
import styles from './EditDelayProfileModalContent.css';
|
|
|
|
import styles from './EditDelayProfileModalContent.css';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const protocolOptions = [
|
|
|
|
|
|
|
|
{ key: 'preferUsenet', value: 'Prefer Usenet' },
|
|
|
|
|
|
|
|
{ key: 'preferTorrent', value: 'Prefer Torrent' },
|
|
|
|
|
|
|
|
{ key: 'onlyUsenet', value: 'Only Usenet' },
|
|
|
|
|
|
|
|
{ key: 'onlyTorrent', value: 'Only Torrent' }
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
function EditDelayProfileModalContent(props) {
|
|
|
|
function EditDelayProfileModalContent(props) {
|
|
|
|
const {
|
|
|
|
const {
|
|
|
|
id,
|
|
|
|
id,
|
|
|
@ -25,7 +32,6 @@ function EditDelayProfileModalContent(props) {
|
|
|
|
saveError,
|
|
|
|
saveError,
|
|
|
|
item,
|
|
|
|
item,
|
|
|
|
protocol,
|
|
|
|
protocol,
|
|
|
|
protocolOptions,
|
|
|
|
|
|
|
|
onInputChange,
|
|
|
|
onInputChange,
|
|
|
|
onProtocolChange,
|
|
|
|
onProtocolChange,
|
|
|
|
onSavePress,
|
|
|
|
onSavePress,
|
|
|
@ -51,20 +57,22 @@ function EditDelayProfileModalContent(props) {
|
|
|
|
|
|
|
|
|
|
|
|
<ModalBody>
|
|
|
|
<ModalBody>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
isFetching &&
|
|
|
|
isFetching ?
|
|
|
|
<LoadingIndicator />
|
|
|
|
<LoadingIndicator /> :
|
|
|
|
|
|
|
|
null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
!isFetching && !!error &&
|
|
|
|
!isFetching && !!error ?
|
|
|
|
<div>Unable to add a new quality profile, please try again.</div>
|
|
|
|
<div>Unable to add a new quality profile, please try again.</div> :
|
|
|
|
|
|
|
|
null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
!isFetching && !error &&
|
|
|
|
!isFetching && !error ?
|
|
|
|
<Form {...otherProps}>
|
|
|
|
<Form {...otherProps}>
|
|
|
|
<FormGroup>
|
|
|
|
<FormGroup>
|
|
|
|
<FormLabel>Protocol</FormLabel>
|
|
|
|
<FormLabel>Preferred Protocol</FormLabel>
|
|
|
|
|
|
|
|
|
|
|
|
<FormInputGroup
|
|
|
|
<FormInputGroup
|
|
|
|
type={inputTypes.SELECT}
|
|
|
|
type={inputTypes.SELECT}
|
|
|
@ -140,19 +148,21 @@ function EditDelayProfileModalContent(props) {
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</FormGroup>
|
|
|
|
</FormGroup>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</Form>
|
|
|
|
</Form> :
|
|
|
|
|
|
|
|
null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</ModalBody>
|
|
|
|
</ModalBody>
|
|
|
|
<ModalFooter>
|
|
|
|
<ModalFooter>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
id && id > 1 &&
|
|
|
|
id && id > 1 ?
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
className={styles.deleteButton}
|
|
|
|
className={styles.deleteButton}
|
|
|
|
kind={kinds.DANGER}
|
|
|
|
kind={kinds.DANGER}
|
|
|
|
onPress={onDeleteDelayProfilePress}
|
|
|
|
onPress={onDeleteDelayProfilePress}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
Delete
|
|
|
|
Delete
|
|
|
|
</Button>
|
|
|
|
</Button> :
|
|
|
|
|
|
|
|
null
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
@ -190,7 +200,6 @@ EditDelayProfileModalContent.propTypes = {
|
|
|
|
saveError: PropTypes.object,
|
|
|
|
saveError: PropTypes.object,
|
|
|
|
item: PropTypes.shape(delayProfileShape).isRequired,
|
|
|
|
item: PropTypes.shape(delayProfileShape).isRequired,
|
|
|
|
protocol: PropTypes.string.isRequired,
|
|
|
|
protocol: PropTypes.string.isRequired,
|
|
|
|
protocolOptions: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
|
|
|
|
|
|
onInputChange: PropTypes.func.isRequired,
|
|
|
|
onInputChange: PropTypes.func.isRequired,
|
|
|
|
onProtocolChange: PropTypes.func.isRequired,
|
|
|
|
onProtocolChange: PropTypes.func.isRequired,
|
|
|
|
onSavePress: PropTypes.func.isRequired,
|
|
|
|
onSavePress: PropTypes.func.isRequired,
|
|
|
|