mirror of
https://github.com/CommonLoon102/NBloodServerSupervisor.git
synced 2024-12-23 11:12:47 +01:00
29 lines
791 B
C#
29 lines
791 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using WebInterface.Services;
|
|
|
|
namespace WebInterface.Controllers
|
|
{
|
|
public class HomeController : Controller
|
|
{
|
|
IStateService _stateService;
|
|
|
|
public HomeController(IStateService stateService)
|
|
{
|
|
_stateService = stateService;
|
|
}
|
|
|
|
[Route("nblood/home")]
|
|
public IActionResult Index()
|
|
{
|
|
var servers = _stateService.ListServers(HttpContext.Request.Host.Host).Servers;
|
|
var stats = _stateService.GetStatistics();
|
|
|
|
var viewModel = new HomeViewModel(servers, stats.RunningSinceUtc, stats.ManMinutesPlayed);
|
|
return View(viewModel);
|
|
}
|
|
}
|
|
} |