From ad2be499dba6ea02510aadc64c326dfe4aac4985 Mon Sep 17 00:00:00 2001 From: Marcel Baumgartner Date: Fri, 14 Apr 2023 18:13:51 +0200 Subject: [PATCH] Some random patches --- Moonlight/App/Helpers/DaemonApiHelper.cs | 6 ++++-- Moonlight/App/Helpers/WingsServerConverter.cs | 13 ++++++++----- Moonlight/App/Services/ServerService.cs | 2 ++ Moonlight/Pages/_Layout.cshtml | 6 +++--- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Moonlight/App/Helpers/DaemonApiHelper.cs b/Moonlight/App/Helpers/DaemonApiHelper.cs index 4c776a44..b9ffdcce 100644 --- a/Moonlight/App/Helpers/DaemonApiHelper.cs +++ b/Moonlight/App/Helpers/DaemonApiHelper.cs @@ -16,11 +16,13 @@ public class DaemonApiHelper private string GetApiUrl(Node node) { + /* SSL not implemented in moonlight daemon if(node.Ssl) return $"https://{node.Fqdn}:{node.MoonlightDaemonPort}/"; else - return $"http://{node.Fqdn}:{node.MoonlightDaemonPort}/"; - //return $"https://{node.Fqdn}:{node.HttpPort}/"; + return $"http://{node.Fqdn}:{node.MoonlightDaemonPort}/";*/ + + return $"http://{node.Fqdn}:{node.MoonlightDaemonPort}/"; } public async Task Get(Node node, string resource) diff --git a/Moonlight/App/Helpers/WingsServerConverter.cs b/Moonlight/App/Helpers/WingsServerConverter.cs index 4f22303c..c7375e3d 100644 --- a/Moonlight/App/Helpers/WingsServerConverter.cs +++ b/Moonlight/App/Helpers/WingsServerConverter.cs @@ -118,12 +118,15 @@ public class WingsServerConverter foreach (var section in child.GetSection("find").GetChildren()) { - replaces.Add(new() + if (section.Value != null) { - Match = section.Key, - Replace_With = section.Value - .Replace("{{server.build.default.port}}", def.Port.ToString()) - }); + replaces.Add(new() + { + Match = section.Key, + Replace_With = section.Value + .Replace("{{server.build.default.port}}", def.Port.ToString()) + }); + } } wingsServer.Process_Configuration.Configs.Add(new() diff --git a/Moonlight/App/Services/ServerService.cs b/Moonlight/App/Services/ServerService.cs index 01bc2ee0..2e46eb44 100644 --- a/Moonlight/App/Services/ServerService.cs +++ b/Moonlight/App/Services/ServerService.cs @@ -392,6 +392,8 @@ public class ServerService public async Task Delete(Server s) { + throw new DisplayException("Deleting a server is currently a bit buggy. So its disabled for your safety"); + var server = EnsureNodeData(s); var backups = await GetBackups(server); diff --git a/Moonlight/Pages/_Layout.cshtml b/Moonlight/Pages/_Layout.cshtml index 58779fee..7a5518e6 100644 --- a/Moonlight/Pages/_Layout.cshtml +++ b/Moonlight/Pages/_Layout.cshtml @@ -89,9 +89,9 @@ - - - + + +