Moved BaseUrl from appsettings.json to Database and fixed an issue in UI for setting base url based on a hack, rather than asking backend for it. (#644)
This commit is contained in:
parent
e8e838d125
commit
977e364d5a
10 changed files with 52 additions and 26 deletions
|
@ -50,7 +50,7 @@ namespace API.Data
|
|||
new () {Key = ServerSettingKey.AllowStatCollection, Value = "true"},
|
||||
new () {Key = ServerSettingKey.EnableOpds, Value = "false"},
|
||||
new () {Key = ServerSettingKey.EnableAuthentication, Value = "true"},
|
||||
new () {Key = ServerSettingKey.BaseUrl, Value = ""},// Not used from DB, but DB is sync with appSettings.json
|
||||
new () {Key = ServerSettingKey.BaseUrl, Value = "/"},
|
||||
};
|
||||
|
||||
foreach (var defaultSetting in defaultSettings)
|
||||
|
@ -64,20 +64,11 @@ namespace API.Data
|
|||
|
||||
await context.SaveChangesAsync();
|
||||
|
||||
if (string.IsNullOrEmpty(Configuration.BaseUrl))
|
||||
{
|
||||
Configuration.BaseUrl = "/";
|
||||
}
|
||||
|
||||
// Port and LoggingLevel are managed in appSettings.json. Update the DB values to match
|
||||
context.ServerSetting.First(s => s.Key == ServerSettingKey.Port).Value =
|
||||
Configuration.Port + string.Empty;
|
||||
context.ServerSetting.First(s => s.Key == ServerSettingKey.LoggingLevel).Value =
|
||||
Configuration.LogLevel + string.Empty;
|
||||
context.ServerSetting.First(s => s.Key == ServerSettingKey.BaseUrl).Value =
|
||||
Configuration.BaseUrl;
|
||||
|
||||
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue