test
Some checks failed
Gitea CI/CD / dotnet-build-and-test (push) Failing after 38s
Gitea CI/CD / Set Tag Name (push) Has been skipped
Gitea CI/CD / docker-build-and-push (push) Has been skipped
Gitea CI/CD / Create Tag (push) Has been skipped

This commit is contained in:
2026-01-07 12:47:23 +01:00
parent 24538d8030
commit f09434d66d
9 changed files with 394 additions and 2 deletions

View File

@@ -3,6 +3,8 @@ using Microsoft.AspNetCore.Mvc;
using watcher_monitoring.Models;
using watcher_monitoring.Data;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
namespace watcher_monitoring.Controllers;
@@ -18,9 +20,11 @@ public class HomeController : Controller
}
// Dashboard
public IActionResult Index()
public async Task<IActionResult> Index()
{
var servers = new List<dynamic>
List<Server> servers = await _dbContext.Servers.ToListAsync();
var servers1 = new List<dynamic>
{
new { Name = "Web Server 01", IPAddress = "192.168.1.10", IsOnline = true },
new { Name = "Database Server", IPAddress = "192.168.1.20", IsOnline = true },

View File

@@ -59,7 +59,19 @@ public class MonitoringController : Controller
Server server = await _context.Servers.FindAsync(dto.Id);
// Add Hardware Configuration
try
{
server.CpuType = dto.CpuType;
server.CpuCores = dto.CpuCores;
server.GpuType = dto.GpuType;
server.RamSize = dto.RamSize;
// Diskspace fehlt
}
catch (Exception ex)
{
_logger.LogError(ex.Message);
}
}
catch (Exception ex)
{