Added EonaCat.LogStack.Status
Updated EonaCat.LogStack.LogClient to support EonaCat.LogStack.Status
This commit is contained in:
20
EonaCat.LogStack.Status/Pages/Certificates.cshtml.cs
Normal file
20
EonaCat.LogStack.Status/Pages/Certificates.cshtml.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user