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