Initial commit
This commit is contained in:
commit
77d35ff965
51 changed files with 5591 additions and 0 deletions
29
Pages/Forgejo/Actions.cshtml.cs
Normal file
29
Pages/Forgejo/Actions.cshtml.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue