Extra warning for Windows Service issues when prompted to restart after changing host settings
Closes #3094
This commit is contained in:
parent
9ad3b12403
commit
fc0b1e8941
|
@ -16,6 +16,19 @@ import ProxySettings from './ProxySettings';
|
||||||
import SecuritySettings from './SecuritySettings';
|
import SecuritySettings from './SecuritySettings';
|
||||||
import UpdateSettings from './UpdateSettings';
|
import UpdateSettings from './UpdateSettings';
|
||||||
|
|
||||||
|
const requiresRestartKeys = [
|
||||||
|
'bindAddress',
|
||||||
|
'port',
|
||||||
|
'urlBase',
|
||||||
|
'enableSsl',
|
||||||
|
'sslPort',
|
||||||
|
'sslCertHash',
|
||||||
|
'authenticationMethod',
|
||||||
|
'username',
|
||||||
|
'password',
|
||||||
|
'apiKey'
|
||||||
|
];
|
||||||
|
|
||||||
class GeneralSettings extends Component {
|
class GeneralSettings extends Component {
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -42,20 +55,7 @@ class GeneralSettings extends Component {
|
||||||
|
|
||||||
const prevSettings = prevProps.settings;
|
const prevSettings = prevProps.settings;
|
||||||
|
|
||||||
const keys = [
|
const pendingRestart = _.some(requiresRestartKeys, (key) => {
|
||||||
'bindAddress',
|
|
||||||
'port',
|
|
||||||
'urlBase',
|
|
||||||
'enableSsl',
|
|
||||||
'sslPort',
|
|
||||||
'sslCertHash',
|
|
||||||
'authenticationMethod',
|
|
||||||
'username',
|
|
||||||
'password',
|
|
||||||
'apiKey'
|
|
||||||
];
|
|
||||||
|
|
||||||
const pendingRestart = _.some(keys, (key) => {
|
|
||||||
const setting = settings[key];
|
const setting = settings[key];
|
||||||
const prevSetting = prevSettings[key];
|
const prevSetting = prevSettings[key];
|
||||||
|
|
||||||
|
@ -98,6 +98,7 @@ class GeneralSettings extends Component {
|
||||||
isResettingApiKey,
|
isResettingApiKey,
|
||||||
isMono,
|
isMono,
|
||||||
isWindows,
|
isWindows,
|
||||||
|
isWindowsService,
|
||||||
mode,
|
mode,
|
||||||
packageUpdateMechanism,
|
packageUpdateMechanism,
|
||||||
onInputChange,
|
onInputChange,
|
||||||
|
@ -179,7 +180,9 @@ class GeneralSettings extends Component {
|
||||||
isOpen={this.state.isRestartRequiredModalOpen}
|
isOpen={this.state.isRestartRequiredModalOpen}
|
||||||
kind={kinds.DANGER}
|
kind={kinds.DANGER}
|
||||||
title="Restart Sonarr"
|
title="Restart Sonarr"
|
||||||
message="Sonarr requires a restart to apply changes, do you want to restart now?"
|
message={
|
||||||
|
`Sonarr requires a restart to apply changes, do you want to restart now? ${isWindowsService ? 'Depending which user is running the Sonarr service you may need to restart Sonarr as admin once before the service will start automatically.' : ''}`
|
||||||
|
}
|
||||||
cancelLabel="I'll restart later"
|
cancelLabel="I'll restart later"
|
||||||
confirmLabel="Restart Now"
|
confirmLabel="Restart Now"
|
||||||
onConfirm={this.onConfirmRestart}
|
onConfirm={this.onConfirmRestart}
|
||||||
|
@ -203,6 +206,7 @@ GeneralSettings.propTypes = {
|
||||||
hasSettings: PropTypes.bool.isRequired,
|
hasSettings: PropTypes.bool.isRequired,
|
||||||
isMono: PropTypes.bool.isRequired,
|
isMono: PropTypes.bool.isRequired,
|
||||||
isWindows: PropTypes.bool.isRequired,
|
isWindows: PropTypes.bool.isRequired,
|
||||||
|
isWindowsService: PropTypes.bool.isRequired,
|
||||||
mode: PropTypes.string.isRequired,
|
mode: PropTypes.string.isRequired,
|
||||||
packageUpdateMechanism: PropTypes.string.isRequired,
|
packageUpdateMechanism: PropTypes.string.isRequired,
|
||||||
onInputChange: PropTypes.func.isRequired,
|
onInputChange: PropTypes.func.isRequired,
|
||||||
|
|
|
@ -26,6 +26,7 @@ function createMapStateToProps() {
|
||||||
isResettingApiKey,
|
isResettingApiKey,
|
||||||
isMono: systemStatus.isMono,
|
isMono: systemStatus.isMono,
|
||||||
isWindows: systemStatus.isWindows,
|
isWindows: systemStatus.isWindows,
|
||||||
|
isWindowsService: systemStatus.isWindows && systemStatus.mode === 'service',
|
||||||
mode: systemStatus.mode,
|
mode: systemStatus.mode,
|
||||||
packageUpdateMechanism: systemStatus.packageUpdateMechanism,
|
packageUpdateMechanism: systemStatus.packageUpdateMechanism,
|
||||||
...sectionSettings
|
...sectionSettings
|
||||||
|
|
Loading…
Reference in New Issue