28 lines
680 B
C#
28 lines
680 B
C#
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||
|
|
using PlanTempusAdmin.Models;
|
||
|
|
using PlanTempusAdmin.Services;
|
||
|
|
|
||
|
|
namespace PlanTempusAdmin.Pages.Forgejo;
|
||
|
|
|
||
|
|
public class IndexModel : PageModel
|
||
|
|
{
|
||
|
|
private readonly ForgejoService _forgejoService;
|
||
|
|
|
||
|
|
public bool IsConnected { get; set; }
|
||
|
|
public ForgejoDashboard Dashboard { get; set; } = new();
|
||
|
|
|
||
|
|
public IndexModel(ForgejoService forgejoService)
|
||
|
|
{
|
||
|
|
_forgejoService = forgejoService;
|
||
|
|
}
|
||
|
|
|
||
|
|
public async Task OnGetAsync()
|
||
|
|
{
|
||
|
|
IsConnected = await _forgejoService.TestConnectionAsync();
|
||
|
|
if (IsConnected)
|
||
|
|
{
|
||
|
|
Dashboard = await _forgejoService.GetDashboardAsync();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|