29 lines
817 B
C#
29 lines
817 B
C#
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
using PlanTempusAdmin.Models;
|
|
using PlanTempusAdmin.Services;
|
|
|
|
namespace PlanTempusAdmin.Pages.Forgejo;
|
|
|
|
public class ActionsModel : PageModel
|
|
{
|
|
private readonly ForgejoService _forgejoService;
|
|
|
|
public bool IsConnected { get; set; }
|
|
public List<ForgejoActionRun> Runs { get; set; } = new();
|
|
public List<ForgejoActionStats> Stats { get; set; } = new();
|
|
|
|
public ActionsModel(ForgejoService forgejoService)
|
|
{
|
|
_forgejoService = forgejoService;
|
|
}
|
|
|
|
public async Task OnGetAsync()
|
|
{
|
|
IsConnected = await _forgejoService.TestConnectionAsync();
|
|
if (IsConnected)
|
|
{
|
|
Runs = await _forgejoService.GetAllActionRunsAsync(100);
|
|
Stats = await _forgejoService.GetActionStatsAsync();
|
|
}
|
|
}
|
|
}
|