Files
Watcher/watcher-monitoring/Controllers/MonitoringController.cs
triggermeelmo 851985a9d0
All checks were successful
Gitea CI/CD / dotnet-build-and-test (push) Successful in 10m5s
Gitea CI/CD / Set Tag Name (push) Successful in 5s
Gitea CI/CD / docker-build-and-push (push) Successful in 11m39s
Gitea CI/CD / Create Tag (push) Successful in 5s
ViewUpdates
2026-01-21 13:52:36 +01:00

43 lines
1.0 KiB
C#

using System.Diagnostics;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using watcher_monitoring.Models;
using watcher_monitoring.Data;
using watcher_monitoring.ViewModels;
using Microsoft.EntityFrameworkCore;
namespace watcher_monitoring.Controllers;
[Authorize]
[Route("[controller]")]
public class MonitoringController : Controller
{
private readonly WatcherDbContext _context;
private readonly ILogger<MonitoringController> _logger;
public MonitoringController(WatcherDbContext context, ILogger<MonitoringController> logger)
{
_context = context;
_logger = logger;
}
[HttpGet("container")]
public async Task<IActionResult> ContainerIndex()
{
return View();
}
[HttpGet("server")]
public async Task <IActionResult> ServerIndex()
{
var ServerIndexViewModel = new ServerIndexViewModel
{
servers = await _context.Servers.ToListAsync()
};
return View(ServerIndexViewModel);
}
}