test
This commit is contained in:
@@ -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 },
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user