Refactor nav pages, add page to see users of the server

This commit is contained in:
NicolasDorier
2017-09-16 01:15:17 +09:00
parent 6240abbb7b
commit eb9f669224
26 changed files with 176 additions and 63 deletions

View File

@@ -0,0 +1,34 @@
using BTCPayServer.Models;
using BTCPayServer.Models.ServerViewModels;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace BTCPayServer.Controllers
{
public class ServerController : Controller
{
private UserManager<ApplicationUser> _UserManager;
public ServerController(UserManager<ApplicationUser> userManager)
{
_UserManager = userManager;
}
[Route("server/users")]
public IActionResult ListUsers()
{
var users = new UsersViewModel();
users.Users
= _UserManager.Users.Select(u => new UsersViewModel.UserViewModel()
{
Name = u.UserName,
Email = u.Email
}).ToList();
return View(users);
}
}
}