11 Commits

Author SHA1 Message Date
2a2ce28b5f Refactored imports to use the latest moonlight core structure 2026-03-13 09:21:35 +01:00
91887ec047 Renamed migration table. Added nullability to template variable migration 2026-03-12 15:45:51 +00:00
2fc371c219 Fixed typo and wrong type reference in DataContext 2026-03-12 15:01:19 +00:00
9470e06c0f Changed migration history table to specific schema. Added log for applied migrations 2026-03-12 14:43:04 +00:00
2f8665f1d4 Added explicit migration assembly marker for DataContext 2026-03-12 14:11:46 +00:00
4d4f35e2be Fixed default destination variable assignment for style build 2026-03-12 13:59:39 +00:00
609ea3a443 Added nuget package settings. Fixed style building
All checks were successful
Dev Publish: Nuget / Publish MoonlightServers.Api (push) Successful in 17s
Dev Publish: Nuget / Publish MoonlightServers.DaemonShared (push) Successful in 11s
Dev Publish: Nuget / Publish MoonlightServers.Frontend (push) Successful in 32s
Dev Publish: Nuget / Publish MoonlightServers.Shared (push) Successful in 11s
2026-03-12 13:53:30 +00:00
3e19b29cde Removed no restore for frontend host project as it would not be restored by default 2026-03-12 13:35:52 +00:00
1475b89660 Updated workflow to handle sources aithout persisting them 2026-03-12 13:31:49 +00:00
3bb9a08630 Added missing moonlight nuget source 2026-03-12 13:20:49 +00:00
252c4103f3 Added workflow for building nuget packages 2026-03-12 13:16:50 +00:00
38 changed files with 541 additions and 76 deletions

View File

@@ -0,0 +1,69 @@
name: "Dev Publish: Nuget"
on:
workflow_dispatch:
push:
branches:
- v2.1
paths:
- 'MoonlightServers.*/*.csproj'
env:
NUGET_SOURCE: https://git.battlestati.one/api/packages/Moonlight-Panel/nuget/index.json
NUGET_PUBLIC: https://api.nuget.org/v3/index.json
CONFIGURATION: Debug
jobs:
publish:
name: Publish ${{ matrix.project }}
runs-on: linux_amd64
strategy:
matrix:
project:
- MoonlightServers.Api
- MoonlightServers.Shared
- MoonlightServers.DaemonShared
- MoonlightServers.Frontend
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Restore NuGet packages
run: >
dotnet restore ${{ matrix.project }}
--source ${{ env.NUGET_PUBLIC }}
--source ${{ env.NUGET_SOURCE }}
# Frontend requires a host build + Tailwind compilation first
- name: Build frontend host (Frontend only)
if: matrix.project == 'MoonlightServers.Frontend'
run: >
dotnet build Hosts/MoonlightServers.Frontend.Host
--configuration ${{ env.CONFIGURATION }}
- name: Build Tailwind styles (Frontend only)
if: matrix.project == 'MoonlightServers.Frontend'
working-directory: Hosts/MoonlightServers.Frontend.Host/Styles
run: npm install && npm run build
- name: Build project
run: >
dotnet build ${{ matrix.project }}
--configuration ${{ env.CONFIGURATION }}
--no-restore
- name: Pack NuGet package
run: >
dotnet pack ${{ matrix.project }}
--configuration ${{ env.CONFIGURATION }}
--output ./artifacts
--no-build
- name: Push NuGet package
run: >
dotnet nuget push ./artifacts/*.nupkg
--skip-duplicate
--source ${{ env.NUGET_SOURCE }}
--api-key ${{ secrets.ACCESS_TOKEN }}

View File

@@ -8,15 +8,14 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.3"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="10.0.5"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.3">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SimplePlugin" Version="1.0.2"/>
<PackageReference Include="SimplePlugin.Abstractions" Version="1.0.2"/>
</ItemGroup>

View File

@@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.3"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.3" PrivateAssets="all"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.5"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.5" PrivateAssets="all"/>
<PackageReference Include="SimplePlugin" Version="1.0.2"/>
<PackageReference Include="SimplePlugin.Abstractions" Version="1.0.2"/>
</ItemGroup>

View File

@@ -15,8 +15,8 @@ export default function extractTailwindClasses(opts = {}) {
},
OnceExit() {
const classArray = Array.from(classSet).sort();
fs.mkdirSync('../../../Servers.Frontend/Styles', { recursive: true });
fs.writeFileSync('../../../Servers.Frontend/Styles/Servers.Frontend.map', classArray.join('\n'));
fs.mkdirSync('../../../MoonlightServers.Frontend/Styles', { recursive: true });
fs.writeFileSync('../../../MoonlightServers.Frontend/Styles/MoonlightServers.Frontend.map', classArray.join('\n'));
console.log(`Extracted classes ${classArray.length}`);
}
};

View File

@@ -5,7 +5,7 @@
@import "../bin/ShadcnBlazor/default-theme.css";
@import "./theme.css";
@source "../bin/Moonlight.Frontend/*.map";
@source "../bin/**/*.map";
@source "../../../MoonlightServers.Api/**/*.razor";
@source "../../../MoonlightServers.Api/**/*.cs";

View File

@@ -3,8 +3,7 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Hybrid;
using Moonlight.Shared.Http.Requests;
using Moonlight.Shared.Http.Responses;
using Moonlight.Shared.Shared;
using MoonlightServers.Api.Infrastructure.Database;
using MoonlightServers.Api.Infrastructure.Database.Entities;
using MoonlightServers.Api.Infrastructure.Implementations.NodeToken;

View File

@@ -1,8 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Moonlight.Shared.Http.Requests;
using Moonlight.Shared.Http.Responses;
using Moonlight.Shared.Shared;
using MoonlightServers.Api.Infrastructure.Database;
using MoonlightServers.Api.Infrastructure.Database.Entities;
using MoonlightServers.Api.Infrastructure.Database.Json;

View File

@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Moonlight.Shared.Http.Responses;
using Moonlight.Shared.Shared;
using MoonlightServers.Api.Infrastructure.Database;
using MoonlightServers.Api.Infrastructure.Database.Entities;
using MoonlightServers.Shared;

View File

@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Moonlight.Shared.Http.Responses;
using Moonlight.Shared.Shared;
using MoonlightServers.Api.Infrastructure.Database;
using MoonlightServers.Api.Infrastructure.Database.Entities;
using MoonlightServers.Shared;

View File

@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Options;
using Moonlight.Api.Configuration;
using Moonlight.Api.Infrastructure.Database;
using MoonlightServers.Api.Infrastructure.Database.Entities;
namespace MoonlightServers.Api.Infrastructure.Database;
@@ -28,7 +28,12 @@ public class DataContext : DbContext
$"Port={Options.Value.Port};" +
$"Username={Options.Value.Username};" +
$"Password={Options.Value.Password};" +
$"Database={Options.Value.Database}"
$"Database={Options.Value.Database}",
builder =>
{
builder.MigrationsAssembly(typeof(DataContext).Assembly);
builder.MigrationsHistoryTable("MigrationsHistory", "servers");
}
);
}

View File

@@ -23,6 +23,9 @@ public class DbMigrationService : IHostedLifecycleService
await using var scope = ServiceProvider.CreateAsyncScope();
var context = scope.ServiceProvider.GetRequiredService<DataContext>();
var availableMigrations = context.Database.GetMigrations();
Logger.LogTrace("Available migrations: {names}", string.Join(", ", availableMigrations));
var pendingMigrations = await context.Database.GetPendingMigrationsAsync(cancellationToken);
var migrationNames = pendingMigrations.ToArray();

View File

@@ -0,0 +1,313 @@
// <auto-generated />
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MoonlightServers.Api.Infrastructure.Database;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace MoonlightServers.Api.Infrastructure.Database.Migrations
{
[DbContext(typeof(DataContext))]
[Migration("20260312153948_AddedNullabilityForTemplateVariableDefaultValue")]
partial class AddedNullabilityForTemplateVariableDefaultValue
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("servers")
.HasAnnotation("ProductVersion", "10.0.3")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("MoonlightServers.Api.Infrastructure.Database.Entities.Node", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("HttpEndpointUrl")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("character varying(50)");
b.Property<string>("Token")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<string>("TokenId")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("character varying(10)");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.ToTable("Nodes", "servers");
});
modelBuilder.Entity("MoonlightServers.Api.Infrastructure.Database.Entities.Template", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("AllowUserDockerImageChange")
.HasColumnType("boolean");
b.Property<string>("Author")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<int?>("DefaultDockerImageId")
.HasColumnType("integer");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("DonateUrl")
.HasMaxLength(2048)
.HasColumnType("character varying(2048)");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("UpdateUrl")
.HasMaxLength(2048)
.HasColumnType("character varying(2048)");
b.Property<string>("Version")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.ComplexProperty(typeof(Dictionary<string, object>), "FilesConfig", "MoonlightServers.Api.Infrastructure.Database.Entities.Template.FilesConfig#FilesConfig", b1 =>
{
b1.IsRequired();
b1.ComplexCollection(typeof(List<Dictionary<string, object>>), "ConfigurationFiles", "MoonlightServers.Api.Infrastructure.Database.Entities.Template.FilesConfig#FilesConfig.ConfigurationFiles#ConfigurationFile", b2 =>
{
b2.IsRequired();
b2.Property<string>("Parser")
.IsRequired();
b2.Property<string>("Path")
.IsRequired();
b2.ComplexCollection(typeof(List<Dictionary<string, object>>), "Mappings", "MoonlightServers.Api.Infrastructure.Database.Entities.Template.FilesConfig#FilesConfig.ConfigurationFiles#ConfigurationFile.Mappings#ConfigurationFileMapping", b3 =>
{
b3.IsRequired();
b3.Property<string>("Key")
.IsRequired();
b3.Property<string>("Value");
});
});
b1
.ToJson("FilesConfig")
.HasColumnType("jsonb");
});
b.ComplexProperty(typeof(Dictionary<string, object>), "InstallationConfig", "MoonlightServers.Api.Infrastructure.Database.Entities.Template.InstallationConfig#InstallationConfig", b1 =>
{
b1.IsRequired();
b1.Property<string>("DockerImage")
.IsRequired();
b1.Property<string>("Script")
.IsRequired();
b1.Property<string>("Shell")
.IsRequired();
b1
.ToJson("InstallationConfig")
.HasColumnType("jsonb");
});
b.ComplexProperty(typeof(Dictionary<string, object>), "LifecycleConfig", "MoonlightServers.Api.Infrastructure.Database.Entities.Template.LifecycleConfig#LifecycleConfig", b1 =>
{
b1.IsRequired();
b1.PrimitiveCollection<string>("OnlineLogPatterns")
.IsRequired();
b1.Property<string>("StopCommand")
.IsRequired();
b1.ComplexCollection(typeof(List<Dictionary<string, object>>), "StartupCommands", "MoonlightServers.Api.Infrastructure.Database.Entities.Template.LifecycleConfig#LifecycleConfig.StartupCommands#StartupCommand", b2 =>
{
b2.IsRequired();
b2.Property<string>("Command")
.IsRequired();
b2.Property<string>("DisplayName")
.IsRequired();
});
b1
.ToJson("LifecycleConfig")
.HasColumnType("jsonb");
});
b.ComplexProperty(typeof(Dictionary<string, object>), "MiscellaneousConfig", "MoonlightServers.Api.Infrastructure.Database.Entities.Template.MiscellaneousConfig#MiscellaneousConfig", b1 =>
{
b1.IsRequired();
b1.Property<bool>("UseLegacyStartup");
b1
.ToJson("MiscellaneousConfig")
.HasColumnType("jsonb");
});
b.HasKey("Id");
b.HasIndex("DefaultDockerImageId")
.IsUnique();
b.ToTable("Templates", "servers");
});
modelBuilder.Entity("MoonlightServers.Api.Infrastructure.Database.Entities.TemplateDockerImage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("ImageName")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<bool>("SkipPulling")
.HasColumnType("boolean");
b.Property<int>("TemplateId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("TemplateId");
b.ToTable("TemplateDockerImages", "servers");
});
modelBuilder.Entity("MoonlightServers.Api.Infrastructure.Database.Entities.TemplateVariable", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("DefaultValue")
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("character varying(30)");
b.Property<string>("EnvName")
.IsRequired()
.HasMaxLength(60)
.HasColumnType("character varying(60)");
b.Property<int>("TemplateId")
.HasColumnType("integer");
b.HasKey("Id");
b.HasIndex("TemplateId");
b.ToTable("TemplateVariablesVariables", "servers");
});
modelBuilder.Entity("MoonlightServers.Api.Infrastructure.Database.Entities.Template", b =>
{
b.HasOne("MoonlightServers.Api.Infrastructure.Database.Entities.TemplateDockerImage", "DefaultDockerImage")
.WithOne()
.HasForeignKey("MoonlightServers.Api.Infrastructure.Database.Entities.Template", "DefaultDockerImageId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("DefaultDockerImage");
});
modelBuilder.Entity("MoonlightServers.Api.Infrastructure.Database.Entities.TemplateDockerImage", b =>
{
b.HasOne("MoonlightServers.Api.Infrastructure.Database.Entities.Template", "Template")
.WithMany("DockerImages")
.HasForeignKey("TemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Template");
});
modelBuilder.Entity("MoonlightServers.Api.Infrastructure.Database.Entities.TemplateVariable", b =>
{
b.HasOne("MoonlightServers.Api.Infrastructure.Database.Entities.Template", "Template")
.WithMany("Variables")
.HasForeignKey("TemplateId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Template");
});
modelBuilder.Entity("MoonlightServers.Api.Infrastructure.Database.Entities.Template", b =>
{
b.Navigation("DockerImages");
b.Navigation("Variables");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,42 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MoonlightServers.Api.Infrastructure.Database.Migrations
{
/// <inheritdoc />
public partial class AddedNullabilityForTemplateVariableDefaultValue : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "DefaultValue",
schema: "servers",
table: "TemplateVariablesVariables",
type: "character varying(1024)",
maxLength: 1024,
nullable: true,
oldClrType: typeof(string),
oldType: "character varying(1024)",
oldMaxLength: 1024);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "DefaultValue",
schema: "servers",
table: "TemplateVariablesVariables",
type: "character varying(1024)",
maxLength: 1024,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "character varying(1024)",
oldMaxLength: 1024,
oldNullable: true);
}
}
}

View File

@@ -126,8 +126,7 @@ namespace MoonlightServers.Api.Infrastructure.Database.Migrations
b3.Property<string>("Key")
.IsRequired();
b3.Property<string>("Value")
.IsRequired();
b3.Property<string>("Value");
});
});
@@ -239,7 +238,6 @@ namespace MoonlightServers.Api.Infrastructure.Database.Migrations
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("DefaultValue")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("character varying(1024)");

View File

@@ -6,14 +6,23 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Label="Nuget Package Settings">
<Version>2.1.0</Version>
<Title>MoonlightServers.Api</Title>
<Authors>Moonlight Panel</Authors>
<Description>Development package of MoonlightServers.Api</Description>
<Copyright>Moonlight Panel</Copyright>
<PackageProjectUrl>https://git.battlestati.one/Moonlight-Panel/Servers</PackageProjectUrl>
<PackageLicenseUrl>https://git.battlestati.one/Moonlight-Panel/Servers/src/branch/v2.1/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://git.battlestati.one/Moonlight-Panel/Servers</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="10.0.3" />
<PackageReference Include="Moonlight.Api" Version="2.1.0">
<ExcludeAssets>content;contentfiles</ExcludeAssets>
</PackageReference>

View File

@@ -8,8 +8,8 @@ using MoonlightServers.Api.Admin.Templates;
using MoonlightServers.Api.Infrastructure.Configuration;
using MoonlightServers.Api.Infrastructure.Database;
using MoonlightServers.Api.Infrastructure.Implementations.NodeToken;
using MoonlightServers.Shared;
using SimplePlugin.Abstractions;
using SerializationContext = MoonlightServers.Shared.SerializationContext;
namespace MoonlightServers.Api;

View File

@@ -6,6 +6,18 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Label="Nuget Package Settings">
<Version>2.1.0</Version>
<Title>MoonlightServers.DaemonShared</Title>
<Authors>Moonlight Panel</Authors>
<Description>Development package of MoonlightServers.DaemonShared</Description>
<Copyright>Moonlight Panel</Copyright>
<PackageProjectUrl>https://git.battlestati.one/Moonlight-Panel/Servers</PackageProjectUrl>
<PackageLicenseUrl>https://git.battlestati.one/Moonlight-Panel/Servers/src/branch/v2.1/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://git.battlestati.one/Moonlight-Panel/Servers</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<ItemGroup>
<Folder Include="Http\Panel\" />
</ItemGroup>

View File

@@ -1,7 +1,7 @@
@page "/admin/servers/nodes/create"
@using LucideBlazor
@using Moonlight.Frontend.Helpers
@using Moonlight.Frontend.Infrastructure.Helpers
@using MoonlightServers.Shared
@using MoonlightServers.Shared.Admin.Nodes
@using ShadcnBlazor.Buttons

View File

@@ -2,7 +2,7 @@
@using System.Net
@using LucideBlazor
@using Moonlight.Frontend.Helpers
@using Moonlight.Frontend.Infrastructure.Helpers
@using MoonlightServers.Shared
@using MoonlightServers.Shared.Admin.Nodes
@using ShadcnBlazor.Buttons

View File

@@ -1,13 +1,11 @@
@using LucideBlazor
@using Moonlight.Shared.Http.Requests
@using Moonlight.Shared.Http.Responses
@using Moonlight.Shared.Shared
@using MoonlightServers.Shared
@using MoonlightServers.Shared.Admin.Nodes
@using ShadcnBlazor.DataGrids
@using ShadcnBlazor.Buttons
@using ShadcnBlazor.Dropdowns
@using ShadcnBlazor.Extras.AlertDialogs
@using ShadcnBlazor.Extras.Dialogs
@using ShadcnBlazor.Extras.Toasts
@using ShadcnBlazor.Tabels

View File

@@ -1,7 +1,7 @@
@page "/admin/servers/templates/create"
@using LucideBlazor
@using Moonlight.Frontend.Helpers
@using Moonlight.Frontend.Infrastructure.Helpers
@using MoonlightServers.Shared
@using MoonlightServers.Shared.Admin.Templates
@using ShadcnBlazor.Buttons
@@ -10,7 +10,6 @@
@using ShadcnBlazor.Extras.Toasts
@using ShadcnBlazor.Fields
@using ShadcnBlazor.Inputs
@using ShadcnBlazor.Tab
@inject HttpClient HttpClient
@inject NavigationManager Navigation

View File

@@ -1,4 +1,4 @@
@using Moonlight.Frontend.Helpers
@using Moonlight.Frontend.Infrastructure.Helpers
@using MoonlightServers.Shared
@using MoonlightServers.Shared.Admin.Templates
@using ShadcnBlazor.Dialogs

View File

@@ -1,4 +1,4 @@
@using Moonlight.Frontend.Helpers
@using Moonlight.Frontend.Infrastructure.Helpers
@using MoonlightServers.Shared
@using MoonlightServers.Shared.Admin.Templates
@using ShadcnBlazor.Dialogs

View File

@@ -1,6 +1,6 @@
@using System.Text.Json
@using LucideBlazor
@using Moonlight.Shared.Http.Responses
@using Moonlight.Shared.Shared
@using MoonlightServers.Shared
@using MoonlightServers.Shared.Admin.Templates
@using ShadcnBlazor.Extras.Common
@@ -206,7 +206,7 @@
try
{
var problemDetails = await response.Content.ReadFromJsonAsync<ProblemDetails>(
Moonlight.Shared.Http.SerializationContext.Default.Options
Moonlight.Shared.SerializationContext.Default.Options
);
if (problemDetails == null)

View File

@@ -1,6 +1,5 @@
@using LucideBlazor
@using Moonlight.Shared.Http.Requests
@using Moonlight.Shared.Http.Responses
@using Moonlight.Shared.Shared
@using MoonlightServers.Shared
@using MoonlightServers.Shared.Admin.Templates
@using ShadcnBlazor.DataGrids

View File

@@ -1,9 +1,8 @@
@page "/admin/servers/templates/{Id:int}"
@using System.Net
@using System.Text.Json
@using LucideBlazor
@using Moonlight.Frontend.Helpers
@using Moonlight.Frontend.Infrastructure.Helpers
@using MoonlightServers.Shared
@using MoonlightServers.Shared.Admin.Templates
@using ShadcnBlazor.Buttons

View File

@@ -1,5 +1,5 @@
@using LucideBlazor
@using Moonlight.Frontend.Helpers
@using Moonlight.Frontend.Infrastructure.Helpers
@using MoonlightServers.Shared
@using MoonlightServers.Shared.Admin.Templates
@using ShadcnBlazor.Accordions

View File

@@ -1,12 +1,9 @@
@using LucideBlazor
@using Moonlight.Shared.Http.Responses
@using Moonlight.Shared.Shared
@using MoonlightServers.Shared.Admin.Templates
@using ShadcnBlazor.Accordions
@using ShadcnBlazor.Buttons
@using ShadcnBlazor.Extras.Common
@using ShadcnBlazor.Extras.Dialogs
@using ShadcnBlazor.Fields
@using ShadcnBlazor.Inputs
@inject HttpClient HttpClient
@inject DialogService DialogService

View File

@@ -1,6 +1,6 @@
using LucideBlazor;
using Moonlight.Frontend.Interfaces;
using Moonlight.Frontend.Models;
using Moonlight.Frontend.Admin.Users.Shared;
using Moonlight.Frontend.Infrastructure.Hooks;
using MoonlightServers.Shared;
namespace MoonlightServers.Frontend.Infrastructure;

View File

@@ -1,6 +1,6 @@
using LucideBlazor;
using Moonlight.Frontend.Interfaces;
using Moonlight.Frontend.Models;
using Moonlight.Frontend.Infrastructure.Hooks;
using Moonlight.Frontend.Infrastructure.Models;
using MoonlightServers.Shared;
namespace MoonlightServers.Frontend.Infrastructure;

View File

@@ -6,6 +6,17 @@
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup Label="Nuget Package Settings">
<Version>2.1.0</Version>
<Title>MoonlightServers.Frontend</Title>
<Authors>Moonlight Panel</Authors>
<Description>Development package of MoonlightServers.Frontend</Description>
<Copyright>Moonlight Panel</Copyright>
<PackageProjectUrl>https://git.battlestati.one/Moonlight-Panel/Servers</PackageProjectUrl>
<PackageLicenseUrl>https://git.battlestati.one/Moonlight-Panel/Servers/src/branch/v2.1/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://git.battlestati.one/Moonlight-Panel/Servers</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser"/>
@@ -27,8 +38,8 @@
<ItemGroup>
<None Include="Styles/*" Pack="true" PackagePath="Styles/"/>
<None Include="Servers.Frontend.targets" Pack="true" PackagePath="build\Servers.Frontend.targets"/>
<None Include="Servers.Frontend.targets" Pack="true" PackagePath="buildTransitive\Servers.Frontend.targets"/>
<None Include="MoonlightServers.Frontend.targets" Pack="true" PackagePath="build\MoonlightServers.Frontend.targets" />
<None Include="MoonlightServers.Frontend.targets" Pack="true" PackagePath="buildTransitive\MoonlightServers.Frontend.targets"/>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,15 @@
<Project>
<PropertyGroup>
<MoonlightServersCssClassDir Condition="'$(MoonlightServersCssClassDir)' == ''">
$(MSBuildProjectDirectory)\bin\MoonlightServers
</MoonlightServersCssClassDir>
</PropertyGroup>
<Target Name="MoonlightServers_CopyContents" BeforeTargets="Build">
<ItemGroup>
<Files Include="$(MSBuildThisFileDirectory)..\Styles\**\*" />
</ItemGroup>
<Copy SourceFiles="@(Files)" DestinationFolder="$(MoonlightServersCssClassDir)" SkipUnchangedFiles="true" />
</Target>
</Project>

View File

@@ -1,15 +0,0 @@
<Project>
<PropertyGroup>
<ServersCssClassDir Condition="'$(ServersCssClassDir)' == ''">
$(MSBuildProjectDirectory)\bin\Servers
</ServersCssClassDir>
</PropertyGroup>
<Target Name="Servers_CopyContents" BeforeTargets="Build">
<ItemGroup>
<Files Include="$(MSBuildThisFileDirectory)..\Styles\**\*" />
</ItemGroup>
<Copy SourceFiles="@(Files)" DestinationFolder="$(ServersCssClassDir)" SkipUnchangedFiles="true" />
</Target>
</Project>

View File

@@ -1,8 +1,8 @@
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Moonlight.Frontend;
using Moonlight.Frontend.Configuration;
using Moonlight.Frontend.Interfaces;
using Moonlight.Frontend.Infrastructure.Configuration;
using Moonlight.Frontend.Infrastructure.Hooks;
using MoonlightServers.Frontend.Infrastructure;
using SimplePlugin.Abstractions;

View File

@@ -0,0 +1 @@
THIS WILL BE AUTOGENERATED DURING PACKAGE BUILD

View File

@@ -6,6 +6,18 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Label="Nuget Package Settings">
<Version>2.1.0</Version>
<Title>MoonlightServers.Shared</Title>
<Authors>Moonlight Panel</Authors>
<Description>Development package of MoonlightServers.Shared</Description>
<Copyright>Moonlight Panel</Copyright>
<PackageProjectUrl>https://git.battlestati.one/Moonlight-Panel/Servers</PackageProjectUrl>
<PackageLicenseUrl>https://git.battlestati.one/Moonlight-Panel/Servers/src/branch/v2.1/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://git.battlestati.one/Moonlight-Panel/Servers</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Moonlight.Shared" Version="2.1.0" />
</ItemGroup>

View File

@@ -1,6 +1,6 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using Moonlight.Shared.Http.Responses;
using Moonlight.Shared.Shared;
using MoonlightServers.Shared.Admin.Nodes;
using MoonlightServers.Shared.Admin.Templates;
@@ -21,19 +21,18 @@ namespace MoonlightServers.Shared;
[JsonSerializable(typeof(DetailedTemplateDto))]
[JsonSerializable(typeof(PagedData<TemplateDto>))]
[JsonSerializable(typeof(VariableDto))]
[JsonSerializable(typeof(PagedData<VariableDto>))]
[JsonSerializable(typeof(CreateVariableDto))]
[JsonSerializable(typeof(UpdateVariableDto))]
// - Template - Variables
[JsonSerializable(typeof(VariableDto))]
[JsonSerializable(typeof(PagedData<VariableDto>))]
[JsonSerializable(typeof(CreateVariableDto))]
[JsonSerializable(typeof(UpdateVariableDto))]
// - Template - Docker Image
[JsonSerializable(typeof(DockerImageDto))]
[JsonSerializable(typeof(PagedData<DockerImageDto>))]
[JsonSerializable(typeof(CreateDockerImageDto))]
[JsonSerializable(typeof(UpdateDockerImageDto))]
[JsonSourceGenerationOptions(JsonSerializerDefaults.Web)]
public partial class SerializationContext : JsonSerializerContext
{
}

View File

@@ -7,7 +7,9 @@
<Project Path="Hosts\MoonlightServers.Api.Host\MoonlightServers.Api.Host.csproj" />
<Project Path="Hosts\MoonlightServers.Frontend.Host\MoonlightServers.Frontend.Host.csproj" />
</Folder>
<Project Path="MoonlightServers.Api\MoonlightServers.Api.csproj" />
<Project Path="MoonlightServers.Frontend\MoonlightServers.Frontend.csproj" />
<Project Path="MoonlightServers.Shared\MoonlightServers.Shared.csproj" />
<Folder Name="/Panel/">
<Project Path="MoonlightServers.Api\MoonlightServers.Api.csproj" />
<Project Path="MoonlightServers.Frontend\MoonlightServers.Frontend.csproj" />
<Project Path="MoonlightServers.Shared\MoonlightServers.Shared.csproj" />
</Folder>
</Solution>