web: add basic ASP.NET Core web interface

This commit is contained in:
Ske
2019-05-08 20:53:36 +02:00
parent 495edc3c5e
commit 95a7e5e821
13 changed files with 374 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace PluralKit.Web.Pages
{
public class ViewSystem : PageModel
{
private SystemStore _systems;
private MemberStore _members;
public ViewSystem(SystemStore systems, MemberStore members)
{
_systems = systems;
_members = members;
}
public PKSystem System { get; set; }
public IEnumerable<PKMember> Members { get; set; }
public async Task<IActionResult> OnGet(string systemId)
{
System = await _systems.GetByHid(systemId);
if (System == null) return NotFound();
Members = await _members.GetBySystem(System);
return Page();
}
}
}