diff --git a/Moonlight/Dockerfile b/Moonlight/Dockerfile index b2c6537a..b5f1c6b1 100644 --- a/Moonlight/Dockerfile +++ b/Moonlight/Dockerfile @@ -1,9 +1,9 @@ -FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["Moonlight/Moonlight.csproj", "Moonlight/"] diff --git a/Moonlight/Features/Servers/Models/Forms/Admin/Servers/CreateServerForm.cs b/Moonlight/Features/Servers/Models/Forms/Admin/Servers/CreateServerForm.cs index 0ebc5952..c3f6be26 100644 --- a/Moonlight/Features/Servers/Models/Forms/Admin/Servers/CreateServerForm.cs +++ b/Moonlight/Features/Servers/Models/Forms/Admin/Servers/CreateServerForm.cs @@ -51,5 +51,6 @@ public class CreateServerForm [MultiSelection("Port", "Port", Icon = "bx-network-chart")] [Section("Deployment", Icon = "bx-cube")] [CustomItemLoader("FreeAllocations")] + [CustomDisplayFunction("AllocationWithIp")] public List Allocations { get; set; } = new(); } \ No newline at end of file diff --git a/Moonlight/Features/Servers/UI/Views/Admin/Index.razor b/Moonlight/Features/Servers/UI/Views/Admin/Index.razor index c8f71e4e..177ebe9b 100644 --- a/Moonlight/Features/Servers/UI/Views/Admin/Index.razor +++ b/Moonlight/Features/Servers/UI/Views/Admin/Index.razor @@ -5,6 +5,7 @@ @using MoonCore.Abstractions @using MoonCore.Exceptions @using MoonCore.Helpers +@using MoonCoreUI.Models @using MoonCoreUI.Services @using Moonlight.Features.Servers.Entities @using Moonlight.Features.Servers.Models.Enums @@ -26,7 +27,8 @@ CustomAdd="CustomAdd" CustomUpdate="CustomUpdate" ValidateUpdate="ValidateUpdate" - CustomDelete="CustomDelete"> + CustomDelete="CustomDelete" + OnConfigure="OnConfigure"> @@ -46,9 +48,6 @@ - - - Create a new server in order to manage it using this page. Need help? Check out our documentation @@ -58,6 +57,14 @@ @code { + private void OnConfigure(AutoCrudOptions options) + { + options.AddCustomItemLoader("FreeAllocations", LoadFreeAllocations); + + options.AddCustomDisplayFunction("AllocationWithIp", + allocation => allocation.IpAddress + ":" + allocation.Port); + } + private IEnumerable Load(Repository repository) { return repository diff --git a/Moonlight/Moonlight.csproj b/Moonlight/Moonlight.csproj index f6281a36..88b2155f 100644 --- a/Moonlight/Moonlight.csproj +++ b/Moonlight/Moonlight.csproj @@ -1,7 +1,7 @@ - net8.0 + net7.0 enable enable Linux @@ -92,7 +92,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - +