Recreated plugin with new project template. Started implementing server system daemon

This commit is contained in:
2026-03-01 21:09:29 +01:00
parent f6b71f4de6
commit 52dbd13fb5
350 changed files with 2795 additions and 21553 deletions

View File

@@ -1,9 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Admin.NodeAllocations;
public class NodeAllocationResponse
{
public int Id { get; set; }
public string IpAddress { get; set; }
public int Port { get; set; }
}

View File

@@ -1,15 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Admin.Nodes;
public class NodeResponse
{
public int Id { get; set; }
public string Name { get; set; }
public string Fqdn { get; set; }
public int HttpPort { get; set; }
public int FtpPort { get; set; }
public bool EnableTransparentMode { get; set; }
public bool EnableDynamicFirewall { get; set; }
}

View File

@@ -1,15 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Admin.Nodes.Statistics;
public class DockerStatisticsResponse
{
public string Version { get; set; }
public long ImagesUsed { get; set; }
public long ImagesReclaimable { get; set; }
public long ContainersUsed { get; set; }
public long ContainersReclaimable { get; set; }
public long BuildCacheUsed { get; set; }
public long BuildCacheReclaimable { get; set; }
}

View File

@@ -1,36 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Admin.Nodes.Statistics;
public class StatisticsResponse
{
public CpuData Cpu { get; set; }
public MemoryData Memory { get; set; }
public DiskData[] Disks { get; set; }
public record DiskData
{
public string Device { get; set; }
public string MountPath { get; set; }
public ulong DiskTotal { get; set; }
public ulong DiskFree { get; set; }
public ulong InodesTotal { get; set; }
public ulong InodesFree { get; set; }
}
public record MemoryData
{
public long Total { get; set; }
public long Available { get; set; }
public long Free { get; set; }
public long Cached { get; set; }
public long SwapTotal { get; set; }
public long SwapFree { get; set; }
}
public record CpuData
{
public string Model { get; set; }
public double Usage { get; set; }
public double[] UsagePerCore { get; set; }
}
}

View File

@@ -1,10 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Admin.Nodes.Sys;
public class NodeSystemStatusResponse
{
public bool RoundtripSuccess { get; set; }
public bool RoundtripRemoteFailure { get; set; }
public TimeSpan RoundtripTime { get; set; }
public string? RoundtripError { get; set; }
public string Version { get; set; }
}

View File

@@ -1,8 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Admin.ServerVariables;
public class ServerVariableResponse
{
public int Id { get; set; }
public string Key { get; set; }
public string Value { get; set; }
}

View File

@@ -1,24 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Admin.Servers;
public class ServerResponse
{
public int Id { get; set; }
public string Name { get; set; }
public int OwnerId { get; set; }
public int Cpu { get; set; }
public int Memory { get; set; }
public int Disk { get; set; }
public bool UseVirtualDisk { get; set; }
public int Bandwidth { get; set; }
public string? StartupOverride { get; set; }
public int DockerImageIndex { get; set; }
public int StarId { get; set; }
public int NodeId { get; set; }
public int[] AllocationIds { get; set; } = [];
}

View File

@@ -1,10 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Admin.StarDockerImages;
public class StarDockerImageResponse
{
public int Id { get; set; }
public string DisplayName { get; set; }
public string Identifier { get; set; }
public bool AutoPulling { get; set; }
}

View File

@@ -1,20 +0,0 @@
using MoonlightServers.Shared.Enums;
namespace MoonlightServers.Shared.Http.Responses.Admin.StarVariables;
public class StarVariableResponse
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Key { get; set; }
public string DefaultValue { get; set; }
public bool AllowViewing { get; set; }
public bool AllowEditing { get; set; }
public StarVariableType Type { get; set; }
public string? Filter { get; set; }
}

View File

@@ -1,29 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Admin.Stars;
public class StarResponse
{
public int Id { get; set; }
// Meta
public string Name { get; set; }
public string Version { get; set; }
public string Author { get; set; }
public string? UpdateUrl { get; set; }
public string? DonateUrl { get; set; }
// Start and stop
public string StartupCommand { get; set; }
public string StopCommand { get; set; }
public string OnlineDetection { get; set; }
// Install
public string InstallShell { get; set; }
public string InstallDockerImage { get; set; }
public string InstallScript { get; set; }
// Misc
public int RequiredAllocations { get; set; }
public bool AllowDockerImageChange { get; set; }
public int DefaultDockerImage { get; set; }
public string ParseConfiguration { get; set; }
}

View File

@@ -1,8 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Client.Servers.Allocations;
public class AllocationDetailResponse
{
public int Id { get; set; }
public string IpAddress { get; set; }
public int Port { get; set; }
}

View File

@@ -1,6 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Client.Servers.Files;
public class ServerFilesDownloadResponse
{
public string DownloadUrl { get; set; }
}

View File

@@ -1,11 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Client.Servers.Files;
public class ServerFilesEntryResponse
{
public string Name { get; set; }
public bool IsFolder { get; set; }
public long Size { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
}

View File

@@ -1,6 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Client.Servers.Files;
public class ServerFilesUploadResponse
{
public string UploadUrl { get; set; }
}

View File

@@ -1,28 +0,0 @@
using MoonlightServers.Shared.Enums;
using MoonlightServers.Shared.Http.Responses.Client.Servers.Allocations;
namespace MoonlightServers.Shared.Http.Responses.Client.Servers;
public record ServerDetailResponse
{
public int Id { get; set; }
public string Name { get; set; }
public int Cpu { get; set; }
public int Memory { get; set; }
public int Disk { get; set; }
public string NodeName { get; set; }
public string StarName { get; set; }
public AllocationDetailResponse[] Allocations { get; set; }
public ShareData? Share { get; set; } = null;
public record ShareData
{
public string SharedBy { get; set; }
public Dictionary<string, ServerPermissionLevel> Permissions { get; set; }
}
}

View File

@@ -1,6 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Client.Servers;
public class ServerLogsResponse
{
public string[] Messages { get; set; }
}

View File

@@ -1,11 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Client.Servers;
public class ServerStatsResponse
{
public double CpuUsage { get; set; }
public ulong MemoryUsage { get; set; }
public ulong NetworkRead { get; set; }
public ulong NetworkWrite { get; set; }
public ulong IoRead { get; set; }
public ulong IoWrite { get; set; }
}

View File

@@ -1,8 +0,0 @@
using MoonlightServers.Shared.Enums;
namespace MoonlightServers.Shared.Http.Responses.Client.Servers;
public class ServerStatusResponse
{
public ServerState State { get; set; }
}

View File

@@ -1,7 +0,0 @@
namespace MoonlightServers.Shared.Http.Responses.Client.Servers;
public class ServerWebSocketResponse
{
public string Target { get; set; }
public string AccessToken { get; set; }
}

View File

@@ -1,10 +0,0 @@
using MoonlightServers.Shared.Enums;
namespace MoonlightServers.Shared.Http.Responses.Client.Servers.Shares;
public class ServerShareResponse
{
public int Id { get; set; }
public string Username { get; set; }
public Dictionary<string, ServerPermissionLevel> Permissions { get; set; }
}

View File

@@ -1,14 +0,0 @@
using MoonlightServers.Shared.Enums;
namespace MoonlightServers.Shared.Http.Responses.Client.Servers.Variables;
public class ServerVariableDetailResponse
{
public string Key { get; set; }
public string Value { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public StarVariableType Type { get; set; }
public string? Filter { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace MoonlightServers.Shared.Http.Responses;
public class FormResultDto
{
public string Result { get; set; }
}