finish initial implementing application configuration editing through webfront

todo: server configuration
This commit is contained in:
RaidMax
2019-04-12 22:25:18 -05:00
parent f0fd4c66e9
commit b9c4a1b5f6
9 changed files with 64 additions and 168 deletions

View File

@ -8,6 +8,7 @@ namespace SharedLibraryCore.Configuration
{
public class ApplicationConfiguration : IBaseConfiguration
{
[LocalizedDisplayName("SETUP_ENABLE_WEBFRONT")]
[LinkedConfiguration("WebfrontBindUrl", "ManualWebfrontUrl")]
public bool EnableWebFront { get; set; }
@ -76,6 +77,7 @@ namespace SharedLibraryCore.Configuration
public List<string> GlobalRules { get; set; }
[LocalizedDisplayName("WEBFRONT_CONFIGURATION_DISALLOWED_NAMES")]
public List<string> DisallowedClientNames { get; set; }
[UIHint("ServerConfiguration")]
public List<ServerConfiguration> Servers { get; set; }

View File

@ -1,5 +1,6 @@
using Newtonsoft.Json;
using SharedLibraryCore.Interfaces;
using System;
using System.IO;
using System.Threading.Tasks;

View File

@ -171,6 +171,12 @@ namespace SharedLibraryCore.Services
// the alias is the same so we can just remove it
if (oldAlias.AliasId != existingExactAlias.AliasId && oldAlias.AliasId > 0)
{
await context.Clients
.Where(_client => _client.CurrentAliasId == oldAlias.AliasId)
.ForEachAsync(_client => _client.CurrentAliasId = existingExactAlias.AliasId);
await context.SaveChangesAsync();
entity.CurrentServer.Logger.WriteDebug($"[updatealias] {entity} has exact alias match, so we're going to try to remove aliasId {oldAlias.AliasId} with linkId {oldAlias.AliasId}");
context.Aliases.Remove(oldAlias);
await context.SaveChangesAsync();