Implemented server killing. Updated server manage ui. Added latest tailwind stuff. Added internal error handling

This commit is contained in:
2025-02-15 20:26:10 +01:00
parent 1fbf1ae9ec
commit 56d4313fa8
12 changed files with 294 additions and 109 deletions

View File

@@ -17,7 +17,7 @@ public class ServerPowerController : Controller
}
[HttpPost("{serverId:int}/start")]
public async Task Start(int serverId, [FromQuery] bool runAsync = true)
public async Task Start(int serverId)
{
var server = ServerService.GetServer(serverId);
@@ -28,7 +28,7 @@ public class ServerPowerController : Controller
}
[HttpPost("{serverId:int}/stop")]
public async Task Stop(int serverId, [FromQuery] bool runAsync = true)
public async Task Stop(int serverId)
{
var server = ServerService.GetServer(serverId);
@@ -39,7 +39,7 @@ public class ServerPowerController : Controller
}
[HttpPost("{serverId:int}/install")]
public async Task Install(int serverId, [FromQuery] bool runAsync = true)
public async Task Install(int serverId)
{
var server = ServerService.GetServer(serverId);
@@ -48,4 +48,15 @@ public class ServerPowerController : Controller
await server.Install();
}
[HttpPost("{serverId:int}/kill")]
public async Task Kill(int serverId)
{
var server = ServerService.GetServer(serverId);
if (server == null)
throw new HttpApiException("No server with this id found", 404);
await server.Kill();
}
}