mirror of
https://github.com/Radarr/Radarr.git
synced 2024-10-05 15:47:20 +02:00
New: Set Instance Name
This commit is contained in:
parent
e7d4429fe4
commit
0559996566
@ -20,6 +20,7 @@ function HostSettings(props) {
|
|||||||
bindAddress,
|
bindAddress,
|
||||||
port,
|
port,
|
||||||
urlBase,
|
urlBase,
|
||||||
|
instanceName,
|
||||||
enableSsl,
|
enableSsl,
|
||||||
sslPort,
|
sslPort,
|
||||||
sslCertPath,
|
sslCertPath,
|
||||||
@ -73,6 +74,22 @@ function HostSettings(props) {
|
|||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
|
<FormGroup
|
||||||
|
advancedSettings={advancedSettings}
|
||||||
|
isAdvanced={true}
|
||||||
|
>
|
||||||
|
<FormLabel>{translate('InstanceName')}</FormLabel>
|
||||||
|
|
||||||
|
<FormInputGroup
|
||||||
|
type={inputTypes.TEXT}
|
||||||
|
name="instanceName"
|
||||||
|
helpText={translate('InstanceNameHelpText')}
|
||||||
|
helpTextWarning={translate('RestartRequiredHelpTextWarning')}
|
||||||
|
onChange={onInputChange}
|
||||||
|
{...instanceName}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
|
||||||
<FormGroup
|
<FormGroup
|
||||||
advancedSettings={advancedSettings}
|
advancedSettings={advancedSettings}
|
||||||
isAdvanced={true}
|
isAdvanced={true}
|
||||||
|
@ -45,11 +45,13 @@ public interface IConfigFileProvider : IHandleAsync<ApplicationStartedEvent>,
|
|||||||
string SslCertPassword { get; }
|
string SslCertPassword { get; }
|
||||||
string UrlBase { get; }
|
string UrlBase { get; }
|
||||||
string UiFolder { get; }
|
string UiFolder { get; }
|
||||||
|
string InstanceName { get; }
|
||||||
bool UpdateAutomatically { get; }
|
bool UpdateAutomatically { get; }
|
||||||
UpdateMechanism UpdateMechanism { get; }
|
UpdateMechanism UpdateMechanism { get; }
|
||||||
string UpdateScriptPath { get; }
|
string UpdateScriptPath { get; }
|
||||||
string SyslogServer { get; }
|
string SyslogServer { get; }
|
||||||
int SyslogPort { get; }
|
int SyslogPort { get; }
|
||||||
|
string SyslogLevel { get; }
|
||||||
string PostgresHost { get; }
|
string PostgresHost { get; }
|
||||||
int PostgresPort { get; }
|
int PostgresPort { get; }
|
||||||
string PostgresUser { get; }
|
string PostgresUser { get; }
|
||||||
@ -223,6 +225,7 @@ public string UrlBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
public string UiFolder => BuildInfo.IsDebug ? Path.Combine("..", "UI") : "UI";
|
public string UiFolder => BuildInfo.IsDebug ? Path.Combine("..", "UI") : "UI";
|
||||||
|
public string InstanceName => GetValue("InstanceName", BuildInfo.AppName);
|
||||||
|
|
||||||
public bool UpdateAutomatically => GetValueBoolean("UpdateAutomatically", false, false);
|
public bool UpdateAutomatically => GetValueBoolean("UpdateAutomatically", false, false);
|
||||||
|
|
||||||
@ -231,8 +234,11 @@ public string UrlBase
|
|||||||
public string UpdateScriptPath => GetValue("UpdateScriptPath", "", false);
|
public string UpdateScriptPath => GetValue("UpdateScriptPath", "", false);
|
||||||
|
|
||||||
public string SyslogServer => GetValue("SyslogServer", "", persist: false);
|
public string SyslogServer => GetValue("SyslogServer", "", persist: false);
|
||||||
|
|
||||||
public int SyslogPort => GetValueInt("SyslogPort", 514, persist: false);
|
public int SyslogPort => GetValueInt("SyslogPort", 514, persist: false);
|
||||||
|
|
||||||
|
public string SyslogLevel => GetValue("SyslogLevel", LogLevel).ToLowerInvariant();
|
||||||
|
|
||||||
public int GetValueInt(string key, int defaultValue, bool persist = true)
|
public int GetValueInt(string key, int defaultValue, bool persist = true)
|
||||||
{
|
{
|
||||||
return Convert.ToInt32(GetValue(key, defaultValue, persist));
|
return Convert.ToInt32(GetValue(key, defaultValue, persist));
|
||||||
|
@ -441,6 +441,8 @@
|
|||||||
"IndexerTagHelpText": "Only use this indexer for movies with at least one matching tag. Leave blank to use with all movies.",
|
"IndexerTagHelpText": "Only use this indexer for movies with at least one matching tag. Leave blank to use with all movies.",
|
||||||
"Info": "Info",
|
"Info": "Info",
|
||||||
"InstallLatest": "Install Latest",
|
"InstallLatest": "Install Latest",
|
||||||
|
"InstanceName": "Instance Name",
|
||||||
|
"InstanceNameHelpText": "Instance name in tab and for Syslog app name",
|
||||||
"InteractiveImport": "Interactive Import",
|
"InteractiveImport": "Interactive Import",
|
||||||
"InteractiveImportErrLanguage": "Language must be chosen for each selected file",
|
"InteractiveImportErrLanguage": "Language must be chosen for each selected file",
|
||||||
"InteractiveImportErrMovie": "Movie must be chosen for each selected file",
|
"InteractiveImportErrMovie": "Movie must be chosen for each selected file",
|
||||||
|
@ -61,5 +61,11 @@ public static IRuleBuilderOptions<T, TProp> AsWarning<T, TProp>(this IRuleBuilde
|
|||||||
{
|
{
|
||||||
return ruleBuilder.WithState(v => NzbDroneValidationState.Warning);
|
return ruleBuilder.WithState(v => NzbDroneValidationState.Warning);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IRuleBuilderOptions<T, string> ContainsRadarr<T>(this IRuleBuilder<T, string> ruleBuilder)
|
||||||
|
{
|
||||||
|
ruleBuilder.SetValidator(new NotEmptyValidator(null));
|
||||||
|
return ruleBuilder.SetValidator(new RegularExpressionValidator("radarr", RegexOptions.IgnoreCase)).WithMessage("Must contain Radarr");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,7 @@ public HostConfigController(IConfigFileProvider configFileProvider,
|
|||||||
SharedValidator.RuleFor(c => c.Port).ValidPort();
|
SharedValidator.RuleFor(c => c.Port).ValidPort();
|
||||||
|
|
||||||
SharedValidator.RuleFor(c => c.UrlBase).ValidUrlBase();
|
SharedValidator.RuleFor(c => c.UrlBase).ValidUrlBase();
|
||||||
|
SharedValidator.RuleFor(c => c.InstanceName).ContainsRadarr().When(c => c.InstanceName.IsNotNullOrWhiteSpace());
|
||||||
|
|
||||||
SharedValidator.RuleFor(c => c.Username).NotEmpty().When(c => c.AuthenticationMethod != AuthenticationType.None);
|
SharedValidator.RuleFor(c => c.Username).NotEmpty().When(c => c.AuthenticationMethod != AuthenticationType.None);
|
||||||
SharedValidator.RuleFor(c => c.Password).NotEmpty().When(c => c.AuthenticationMethod != AuthenticationType.None);
|
SharedValidator.RuleFor(c => c.Password).NotEmpty().When(c => c.AuthenticationMethod != AuthenticationType.None);
|
||||||
|
@ -25,6 +25,7 @@ public class HostConfigResource : RestResource
|
|||||||
public string SslCertPath { get; set; }
|
public string SslCertPath { get; set; }
|
||||||
public string SslCertPassword { get; set; }
|
public string SslCertPassword { get; set; }
|
||||||
public string UrlBase { get; set; }
|
public string UrlBase { get; set; }
|
||||||
|
public string InstanceName { get; set; }
|
||||||
public bool UpdateAutomatically { get; set; }
|
public bool UpdateAutomatically { get; set; }
|
||||||
public UpdateMechanism UpdateMechanism { get; set; }
|
public UpdateMechanism UpdateMechanism { get; set; }
|
||||||
public string UpdateScriptPath { get; set; }
|
public string UpdateScriptPath { get; set; }
|
||||||
@ -66,6 +67,7 @@ public static HostConfigResource ToResource(this IConfigFileProvider model, ICon
|
|||||||
SslCertPath = model.SslCertPath,
|
SslCertPath = model.SslCertPath,
|
||||||
SslCertPassword = model.SslCertPassword,
|
SslCertPassword = model.SslCertPassword,
|
||||||
UrlBase = model.UrlBase,
|
UrlBase = model.UrlBase,
|
||||||
|
InstanceName = model.InstanceName,
|
||||||
UpdateAutomatically = model.UpdateAutomatically,
|
UpdateAutomatically = model.UpdateAutomatically,
|
||||||
UpdateMechanism = model.UpdateMechanism,
|
UpdateMechanism = model.UpdateMechanism,
|
||||||
UpdateScriptPath = model.UpdateScriptPath,
|
UpdateScriptPath = model.UpdateScriptPath,
|
||||||
|
Loading…
Reference in New Issue
Block a user