Implemented server killing. Updated server manage ui. Added latest tailwind stuff. Added internal error handling
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user