Files
EonaCat.LogStack/EonaCat.LogStack.Status/Pages/Certificates.cshtml.cs
EonaCat 977374ce02 Added EonaCat.LogStack.Status
Updated EonaCat.LogStack.LogClient to support EonaCat.LogStack.Status
2026-03-12 21:15:33 +01:00

21 lines
684 B
C#

using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.EntityFrameworkCore;
using EonaCat.LogStack.Status.Data;
using EonaCat.LogStack.Status.Models;
namespace EonaCat.LogStack.Status.Pages;
public class CertificatesModel : PageModel
{
private readonly DatabaseContext _db;
public CertificatesModel(DatabaseContext db) => _db = db;
public List<CertificateEntry> Certificates { get; set; } = new List<CertificateEntry>();
public bool IsAdmin { get; set; }
public async Task OnGetAsync()
{
IsAdmin = HttpContext.Session.GetString("IsAdmin") == "true";
Certificates = await _db.Certificates.OrderBy(c => c.ExpiresAt).ToListAsync();
}
}