mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
New: Set Instance Name
This commit is contained in:
parent
26b9b7665a
commit
1553a8f37b
6 changed files with 31 additions and 0 deletions
|
@ -20,6 +20,7 @@ function HostSettings(props) {
|
||||||
bindAddress,
|
bindAddress,
|
||||||
port,
|
port,
|
||||||
urlBase,
|
urlBase,
|
||||||
|
instanceName,
|
||||||
enableSsl,
|
enableSsl,
|
||||||
sslPort,
|
sslPort,
|
||||||
sslCertPath,
|
sslCertPath,
|
||||||
|
@ -79,6 +80,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}
|
||||||
|
|
|
@ -40,6 +40,7 @@ namespace Lidarr.Api.V1.Config
|
||||||
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).ContainsLidarr().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 @@ namespace Lidarr.Api.V1.Config
|
||||||
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 @@ namespace Lidarr.Api.V1.Config
|
||||||
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,
|
||||||
|
|
|
@ -41,6 +41,7 @@ namespace NzbDrone.Core.Configuration
|
||||||
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; }
|
||||||
|
@ -203,6 +204,7 @@ namespace NzbDrone.Core.Configuration
|
||||||
}
|
}
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
@ -211,6 +213,7 @@ namespace NzbDrone.Core.Configuration
|
||||||
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 int GetValueInt(string key, int defaultValue, bool persist = true)
|
public int GetValueInt(string key, int defaultValue, bool persist = true)
|
||||||
|
|
|
@ -276,6 +276,8 @@
|
||||||
"IndexerPriority": "Indexer Priority",
|
"IndexerPriority": "Indexer Priority",
|
||||||
"Indexers": "Indexers",
|
"Indexers": "Indexers",
|
||||||
"IndexerSettings": "Indexer Settings",
|
"IndexerSettings": "Indexer Settings",
|
||||||
|
"InstanceName": "Instance Name",
|
||||||
|
"InstanceNameHelpText": "Instance name in tab and for Syslog app name",
|
||||||
"InteractiveSearch": "Interactive Search",
|
"InteractiveSearch": "Interactive Search",
|
||||||
"Interval": "Interval",
|
"Interval": "Interval",
|
||||||
"IsCutoffCutoff": "Cutoff",
|
"IsCutoffCutoff": "Cutoff",
|
||||||
|
|
|
@ -61,5 +61,11 @@ namespace NzbDrone.Core.Validation
|
||||||
{
|
{
|
||||||
return ruleBuilder.WithState(v => NzbDroneValidationState.Warning);
|
return ruleBuilder.WithState(v => NzbDroneValidationState.Warning);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IRuleBuilderOptions<T, string> ContainsLidarr<T>(this IRuleBuilder<T, string> ruleBuilder)
|
||||||
|
{
|
||||||
|
ruleBuilder.SetValidator(new NotEmptyValidator(null));
|
||||||
|
return ruleBuilder.SetValidator(new RegularExpressionValidator("lidarr", RegexOptions.IgnoreCase)).WithMessage("Must contain lidarr");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue