1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-24 22:36:19 -04:00

Update UI

Squash into v3 UI
This commit is contained in:
Mark McDowall
2018-11-25 14:40:25 -08:00
committed by Taloth Saldono
parent dbdb8e4436
commit aafa9cb6be
6 changed files with 122 additions and 76 deletions
@@ -99,6 +99,7 @@ class GeneralSettings extends Component {
isMono,
isWindows,
mode,
packageUpdateMechanism,
onInputChange,
onConfirmResetApiKey,
...otherProps
@@ -161,6 +162,7 @@ class GeneralSettings extends Component {
advancedSettings={advancedSettings}
settings={settings}
isMono={isMono}
packageUpdateMechanism={packageUpdateMechanism}
onInputChange={onInputChange}
/>
@@ -202,6 +204,7 @@ GeneralSettings.propTypes = {
isMono: PropTypes.bool.isRequired,
isWindows: PropTypes.bool.isRequired,
mode: PropTypes.string.isRequired,
packageUpdateMechanism: PropTypes.string.isRequired,
onInputChange: PropTypes.func.isRequired,
onConfirmResetApiKey: PropTypes.func.isRequired,
onConfirmRestart: PropTypes.func.isRequired
@@ -27,6 +27,7 @@ function createMapStateToProps() {
isMono: systemStatus.isMono,
isWindows: systemStatus.isWindows,
mode: systemStatus.mode,
packageUpdateMechanism: systemStatus.packageUpdateMechanism,
...sectionSettings
};
}
+51 -41
View File
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import titleCase from 'Utilities/String/titleCase';
import { inputTypes, sizes } from 'Helpers/Props';
import FieldSet from 'Components/FieldSet';
import FormGroup from 'Components/Form/FormGroup';
@@ -11,6 +12,7 @@ function UpdateSettings(props) {
advancedSettings,
settings,
isMono,
packageUpdateMechanism,
onInputChange
} = props;
@@ -30,6 +32,13 @@ function UpdateSettings(props) {
{ key: 'script', value: 'Script' }
];
if (packageUpdateMechanism !== 'builtIn') {
updateOptions.push({
key: packageUpdateMechanism,
value: titleCase(packageUpdateMechanism)
});
}
return (
<FieldSet legend="Updates">
<FormGroup
@@ -50,58 +59,58 @@ function UpdateSettings(props) {
{
isMono &&
<div>
<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
size={sizes.MEDIUM}
>
<FormLabel>Automatic</FormLabel>
<div>
<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
size={sizes.MEDIUM}
>
<FormLabel>Automatic</FormLabel>
<FormInputGroup
type={inputTypes.CHECK}
name="updateAutomatically"
helpText="Automatically download and install updates. You will still be able to install from System: Updates"
onChange={onInputChange}
{...updateAutomatically}
/>
</FormGroup>
<FormInputGroup
type={inputTypes.CHECK}
name="updateAutomatically"
helpText="Automatically download and install updates. You will still be able to install from System: Updates"
onChange={onInputChange}
{...updateAutomatically}
/>
</FormGroup>
<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
>
<FormLabel>Mechanism</FormLabel>
<FormInputGroup
type={inputTypes.SELECT}
name="updateMechanism"
values={updateOptions}
helpText="Use Sonarr's built-in updater or a script"
helpLink="https://github.com/Sonarr/Sonarr/wiki/Updating"
onChange={onInputChange}
{...updateMechanism}
/>
</FormGroup>
{
updateMechanism.value === 'script' &&
<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
>
<FormLabel>Script Path</FormLabel>
<FormLabel>Mechanism</FormLabel>
<FormInputGroup
type={inputTypes.TEXT}
name="updateScriptPath"
helpText="Path to a custom script that takes an extracted update package and handle the remainder of the update process"
type={inputTypes.SELECT}
name="updateMechanism"
values={updateOptions}
helpText="Use Sonarr's built-in updater or a script"
helpLink="https://github.com/Sonarr/Sonarr/wiki/Updating"
onChange={onInputChange}
{...updateScriptPath}
{...updateMechanism}
/>
</FormGroup>
}
</div>
{
updateMechanism.value === 'script' &&
<FormGroup
advancedSettings={advancedSettings}
isAdvanced={true}
>
<FormLabel>Script Path</FormLabel>
<FormInputGroup
type={inputTypes.TEXT}
name="updateScriptPath"
helpText="Path to a custom script that takes an extracted update package and handle the remainder of the update process"
onChange={onInputChange}
{...updateScriptPath}
/>
</FormGroup>
}
</div>
}
</FieldSet>
);
@@ -111,6 +120,7 @@ UpdateSettings.propTypes = {
advancedSettings: PropTypes.bool.isRequired,
settings: PropTypes.object.isRequired,
isMono: PropTypes.bool.isRequired,
packageUpdateMechanism: PropTypes.string.isRequired,
onInputChange: PropTypes.func.isRequired
};