Initial commit
This commit is contained in:
commit
77d35ff965
51 changed files with 5591 additions and 0 deletions
27
Pages/Caddy/Hosts.cshtml.cs
Normal file
27
Pages/Caddy/Hosts.cshtml.cs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
using PlanTempusAdmin.Models;
|
||||
using PlanTempusAdmin.Services;
|
||||
|
||||
namespace PlanTempusAdmin.Pages.Caddy;
|
||||
|
||||
public class HostsModel : PageModel
|
||||
{
|
||||
private readonly CaddyService _caddyService;
|
||||
|
||||
public bool IsRunning { get; set; }
|
||||
public List<CaddyHost> Hosts { get; set; } = new();
|
||||
|
||||
public HostsModel(CaddyService caddyService)
|
||||
{
|
||||
_caddyService = caddyService;
|
||||
}
|
||||
|
||||
public async Task OnGetAsync()
|
||||
{
|
||||
IsRunning = await _caddyService.IsRunningAsync();
|
||||
if (IsRunning)
|
||||
{
|
||||
Hosts = await _caddyService.GetHostsAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue