public async Task <IActionResult> OnGetAsync() { var user = await _userManger.GetUserAsync(User); if (user == null || user.Suspended) { HttpContext.Session.SetString("returnUrl", "bans"); return(RedirectToPage("signIn")); } var now = DateTime.UtcNow; Input = new InputModel { Admin = user.UserName, Date = now.ToString("yyyy-MM-dd"), Time = now.ToString("HH:mm:ss"), }; Bans = await _factorioServerManager.GetBansAsync(); return(Page()); }
public Task <List <Ban> > GetAllBans() { return(_factorioServerManager.GetBansAsync()); }