Implemented server list and power state display

This commit is contained in:
2024-12-28 17:24:38 +01:00
parent 92e9f42fbc
commit 87e4172149
11 changed files with 514 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
using MoonlightServers.DaemonShared.Enums;
using MoonlightServers.Shared.Enums;
namespace MoonlightServers.ApiServer.Extensions;
public static class ServerStateExtensions
{
public static ServerPowerState ToServerPowerState(this ServerState state)
{
return state switch
{
ServerState.Installing => ServerPowerState.Installing,
ServerState.Stopping => ServerPowerState.Stopping,
ServerState.Online => ServerPowerState.Online,
ServerState.Starting => ServerPowerState.Starting,
ServerState.Offline => ServerPowerState.Offline,
_ => ServerPowerState.Offline
};
}
}