Recreated plugin with new project template. Started implementing server system daemon
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace MoonlightServers.DaemonShared.DaemonSide.Http.Requests;
|
||||
|
||||
public class ServerCommandRequest
|
||||
{
|
||||
[Required(ErrorMessage = "The command is required")]
|
||||
public string Command { get; set; }
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using MoonlightServers.DaemonShared.Enums;
|
||||
|
||||
namespace MoonlightServers.DaemonShared.DaemonSide.Http.Requests;
|
||||
|
||||
public class ServerFilesCompressRequest
|
||||
{
|
||||
public string Destination { get; set; }
|
||||
public string[] Items { get; set; }
|
||||
public CompressType Type { get; set; }
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using MoonlightServers.DaemonShared.Enums;
|
||||
|
||||
namespace MoonlightServers.DaemonShared.DaemonSide.Http.Requests;
|
||||
|
||||
public class ServerFilesDecompressRequest
|
||||
{
|
||||
public string Destination { get; set; }
|
||||
public string Path { get; set; }
|
||||
public CompressType Type { get; set; }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.DaemonSide.Http.Responses.Servers;
|
||||
|
||||
public class ServerFileSystemResponse
|
||||
{
|
||||
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; }
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.DaemonSide.Http.Responses.Servers;
|
||||
|
||||
public class ServerLogsResponse
|
||||
{
|
||||
public string[] Messages { get; set; }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.DaemonSide.Http.Responses.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; }
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using MoonlightServers.DaemonShared.Enums;
|
||||
|
||||
namespace MoonlightServers.DaemonShared.DaemonSide.Http.Responses.Servers;
|
||||
|
||||
public class ServerStatusResponse
|
||||
{
|
||||
public ServerState State { get; set; }
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.DaemonSide.Http.Responses.Statistics;
|
||||
|
||||
public class StatisticsDockerResponse
|
||||
{
|
||||
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; }
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.DaemonSide.Http.Responses.Statistics;
|
||||
|
||||
public class StatisticsResponse
|
||||
{
|
||||
public CpuData Cpu { get; set; } = new();
|
||||
public MemoryData Memory { get; set; } = new();
|
||||
|
||||
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; }
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.DaemonSide.Http.Responses.Sys;
|
||||
|
||||
public class SystemStatusResponse
|
||||
{
|
||||
public bool TripSuccess { get; set; }
|
||||
public TimeSpan TripTime { get; set; }
|
||||
public string? TripError { get; set; }
|
||||
public string Version { get; set; }
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.DaemonSide.Models;
|
||||
|
||||
public record ServerStats
|
||||
{
|
||||
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; }
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.Enums;
|
||||
|
||||
public enum CompressType
|
||||
{
|
||||
Zip = 0,
|
||||
TarGz = 1
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.Enums;
|
||||
|
||||
public enum ServerState
|
||||
{
|
||||
Offline = 0,
|
||||
Starting = 1,
|
||||
Online = 2,
|
||||
Stopping = 3,
|
||||
Installing = 4,
|
||||
Locked = 5
|
||||
}
|
||||
@@ -1,21 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Label="Nuget Settings">
|
||||
<Title>MoonlightServers.DaemonShared</Title>
|
||||
<PackageId>MoonlightServers.DaemonShared</PackageId>
|
||||
<Version>2.1.0</Version>
|
||||
<PackageTags>shared</PackageTags>
|
||||
<IsPackable>true</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="DaemonSide\Http\Responses\Servers\Files\"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.PanelSide.Http.Responses;
|
||||
|
||||
public class AllocationDataResponse
|
||||
{
|
||||
public string IpAddress { get; set; }
|
||||
public int Port { get; set; }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.PanelSide.Http.Responses;
|
||||
|
||||
public class ServerDataResponse
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string StartupCommand { get; set; }
|
||||
public string OnlineDetection { get; set; }
|
||||
public string StopCommand { get; set; }
|
||||
public string DockerImage { get; set; }
|
||||
public bool PullDockerImage { get; set; }
|
||||
public string ParseConiguration { get; set; }
|
||||
|
||||
public int Cpu { get; set; }
|
||||
public int Memory { get; set; }
|
||||
public int Disk { get; set; }
|
||||
|
||||
public AllocationDataResponse[] Allocations { get; set; }
|
||||
public Dictionary<string, string> Variables { get; set; }
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace MoonlightServers.DaemonShared.PanelSide.Http.Responses;
|
||||
|
||||
public class ServerInstallDataResponse
|
||||
{
|
||||
public string Shell { get; set; }
|
||||
public string DockerImage { get; set; }
|
||||
public string Script { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user