2017-09-04 02:20:56 +00:00
import PropTypes from 'prop-types' ;
import React from 'react' ;
import FieldSet from 'Components/FieldSet' ;
import Form from 'Components/Form/Form' ;
import FormGroup from 'Components/Form/FormGroup' ;
import FormInputGroup from 'Components/Form/FormInputGroup' ;
2020-09-07 01:33:10 +00:00
import FormLabel from 'Components/Form/FormLabel' ;
import LoadingIndicator from 'Components/Loading/LoadingIndicator' ;
import { inputTypes } from 'Helpers/Props' ;
2017-09-04 02:20:56 +00:00
function IndexerOptions ( props ) {
const {
advancedSettings ,
isFetching ,
error ,
settings ,
hasSettings ,
onInputChange
} = props ;
return (
2018-08-08 00:57:15 +00:00
< FieldSet legend = "Options" >
2017-09-04 02:20:56 +00:00
{
isFetching &&
< LoadingIndicator / >
}
{
! isFetching && error &&
< div > Unable to load indexer options < / d i v >
}
{
hasSettings && ! isFetching && ! error &&
< Form >
< FormGroup >
< FormLabel > Minimum Age < / F o r m L a b e l >
< FormInputGroup
type = { inputTypes . NUMBER }
name = "minimumAge"
2018-01-26 03:01:53 +00:00
min = { 0 }
2018-08-08 00:57:15 +00:00
unit = "minutes"
2017-09-04 02:20:56 +00:00
helpText = "Usenet only: Minimum age in minutes of NZBs before they are grabbed. Use this to give new releases time to propagate to your usenet provider."
onChange = { onInputChange }
{ ... settings . minimumAge }
/ >
< / F o r m G r o u p >
2018-01-14 19:47:36 +00:00
< FormGroup >
< FormLabel > Maximum Size < / F o r m L a b e l >
< FormInputGroup
type = { inputTypes . NUMBER }
name = "maximumSize"
2018-01-26 03:01:53 +00:00
min = { 0 }
2018-08-08 00:57:15 +00:00
unit = "MB"
2018-01-14 19:47:36 +00:00
helpText = "Maximum size for a release to be grabbed in MB. Set to zero to set to unlimited."
onChange = { onInputChange }
{ ... settings . maximumSize }
/ >
< / F o r m G r o u p >
2017-09-04 02:20:56 +00:00
< FormGroup >
< FormLabel > Retention < / F o r m L a b e l >
< FormInputGroup
type = { inputTypes . NUMBER }
name = "retention"
2018-01-26 03:01:53 +00:00
min = { 0 }
2018-08-08 00:57:15 +00:00
unit = "days"
2017-09-04 02:20:56 +00:00
helpText = "Usenet only: Set to zero to set for unlimited retention"
onChange = { onInputChange }
{ ... settings . retention }
/ >
< / F o r m G r o u p >
< FormGroup
advancedSettings = { advancedSettings }
isAdvanced = { true }
>
< FormLabel > RSS Sync Interval < / F o r m L a b e l >
< FormInputGroup
type = { inputTypes . NUMBER }
name = "rssSyncInterval"
2018-01-26 03:01:53 +00:00
min = { 0 }
2018-08-08 00:57:15 +00:00
unit = "minutes"
2017-09-04 02:20:56 +00:00
helpText = "Interval in minutes. Set to zero to disable (this will stop all automatic release grabbing)"
helpTextWarning = "This will apply to all indexers, please follow the rules set forth by them"
2021-08-04 22:47:40 +00:00
helpLink = "https://wiki.servarr.com/lidarr/faq#how-does-lidarr-work"
2017-09-04 02:20:56 +00:00
onChange = { onInputChange }
{ ... settings . rssSyncInterval }
/ >
< / F o r m G r o u p >
< / F o r m >
}
< / F i e l d S e t >
) ;
}
IndexerOptions . propTypes = {
advancedSettings : PropTypes . bool . isRequired ,
isFetching : PropTypes . bool . isRequired ,
error : PropTypes . object ,
settings : PropTypes . object . isRequired ,
hasSettings : PropTypes . bool . isRequired ,
onInputChange : PropTypes . func . isRequired
} ;
export default IndexerOptions ;