initial commit
This commit is contained in:
commit
2d966b8198
28 changed files with 2901 additions and 0 deletions
21
Pages/Server.cshtml.cs
Normal file
21
Pages/Server.cshtml.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using CsWeb.Services;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace CsWeb.Pages;
|
||||
|
||||
public class ServerModel(Fleet fleet) : PageModel
|
||||
{
|
||||
public Fleet Fleet => fleet;
|
||||
public string Id { get; private set; } = "";
|
||||
public Cached<StatusPayload>? Status { get; private set; }
|
||||
|
||||
public async Task<IActionResult> OnGetAsync(string id)
|
||||
{
|
||||
// The slug space is exactly the socket names — anything else 404s before touching a socket path.
|
||||
if (!fleet.Instances().Contains(id)) return NotFound();
|
||||
Id = id;
|
||||
Status = await fleet.Status(id);
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue