diff --git a/Moonlight/Features/Servers/Actions/ServerServiceDefinition.cs b/Moonlight/Features/Servers/Actions/ServerServiceDefinition.cs index d598c1c..5868b7f 100644 --- a/Moonlight/Features/Servers/Actions/ServerServiceDefinition.cs +++ b/Moonlight/Features/Servers/Actions/ServerServiceDefinition.cs @@ -16,8 +16,9 @@ public class ServerServiceDefinition : ServiceDefinition await context.AddPage("Console", "/", "bx bx-sm bxs-terminal"); await context.AddPage("Files", "/files", "bx bx-sm bxs-folder"); - await context.AddPage("Reset", "/reset", "bx bx-sm bx-revision"); + await context.AddPage("Network", "/network", "bx bx-sm bx-cloud"); await context.AddPage("Variables", "/variables", "bx bx-sm bx-slider"); + await context.AddPage("Reset", "/reset", "bx bx-sm bx-revision"); } public override Task BuildAdminView(ServiceViewContext context) diff --git a/Moonlight/Features/Servers/UI/UserViews/Network.razor b/Moonlight/Features/Servers/UI/UserViews/Network.razor new file mode 100644 index 0000000..261bea9 --- /dev/null +++ b/Moonlight/Features/Servers/UI/UserViews/Network.razor @@ -0,0 +1,65 @@ +@using Moonlight.Features.Servers.Entities +@using System.Net + +
+ @foreach (var allocation in Server.Allocations) + { +
+
+
+
+ +
+ @if (allocation.IpAddress == "0.0.0.0") + { + @Server.Node.Fqdn + } + else + { + @allocation.IpAddress + } +
+
+
+ + @if (allocation.IpAddress != "0.0.0.0" || IsIpAddress(Server.Node.Fqdn)) + { +
+ - +
+ } + else + { + //TODO: Resolve domains addresses here +
+ 188.75.252.37 +
+ } +
+
+ +
+ @allocation.Port +
+
+
+ + +
+
+ +
+
+
+
+ } +
+ +@code +{ + [CascadingParameter] public Server Server { get; set; } + + private bool IsIpAddress(string input) => IPAddress.TryParse(input, out _); +} \ No newline at end of file