37 lines
1.0 KiB
C#
37 lines
1.0 KiB
C#
|
using Manarah.App.Models;
|
||
|
using Manarah.App.Services;
|
||
|
using Microsoft.AspNetCore.Mvc;
|
||
|
using System.Diagnostics;
|
||
|
|
||
|
namespace Manarah.App.Controllers
|
||
|
{
|
||
|
public class HomeController : Controller
|
||
|
{
|
||
|
private readonly ILogger<HomeController> _logger;
|
||
|
private readonly ServerService _serverService;
|
||
|
|
||
|
public HomeController(ILogger<HomeController> logger, ServerService serverService)
|
||
|
{
|
||
|
_logger = logger;
|
||
|
_serverService = serverService;
|
||
|
}
|
||
|
|
||
|
public async Task<IActionResult> IndexAsync()
|
||
|
{
|
||
|
var serverList = await _serverService.GetServersDashboardAsync();
|
||
|
return View(serverList);
|
||
|
}
|
||
|
|
||
|
public IActionResult Privacy()
|
||
|
{
|
||
|
return View();
|
||
|
}
|
||
|
|
||
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||
|
public IActionResult Error()
|
||
|
{
|
||
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||
|
}
|
||
|
}
|
||
|
}
|