Compare commits
20 Commits
32a6c0d108
...
developmen
Author | SHA1 | Date | |
---|---|---|---|
0974c1d7dd | |||
0e72287c6b | |||
3918425ef9 | |||
ec13a51575 | |||
b8626cb8ea | |||
281e9c686b | |||
69dd73a079 | |||
2e9d41fe60 | |||
7e75f3e49e | |||
8e362f7271 | |||
df7674f063 | |||
9d0a2e40be | |||
c8dc8adb0d | |||
0aacf369d7 | |||
2d8bf648d9 | |||
85c5a80360 | |||
36e16fbcf9 | |||
52c4243efc | |||
6248fad147 | |||
5e2f9e4c3c |
@@ -10,11 +10,12 @@ env:
|
|||||||
DOCKER_IMAGE_NAME: 'watcher-server'
|
DOCKER_IMAGE_NAME: 'watcher-server'
|
||||||
REGISTRY_URL: 'git.triggermeelmo.com/watcher'
|
REGISTRY_URL: 'git.triggermeelmo.com/watcher'
|
||||||
DOCKER_PLATFORMS: 'linux/amd64,linux/arm64'
|
DOCKER_PLATFORMS: 'linux/amd64,linux/arm64'
|
||||||
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -39,6 +40,8 @@ jobs:
|
|||||||
|
|
||||||
docker-build-and-push:
|
docker-build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
|
||||||
needs: build-and-test
|
needs: build-and-test
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
@@ -1,23 +0,0 @@
|
|||||||
# Read the Docs configuration file
|
|
||||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
||||||
|
|
||||||
# Required
|
|
||||||
version: 2
|
|
||||||
|
|
||||||
# Set the OS, Python version, and other tools you might need
|
|
||||||
build:
|
|
||||||
os: ubuntu-24.04
|
|
||||||
tools:
|
|
||||||
python: "3.13"
|
|
||||||
|
|
||||||
# Build documentation in the "docs/" directory with Sphinx
|
|
||||||
sphinx:
|
|
||||||
configuration: docs/conf.py
|
|
||||||
|
|
||||||
# Optionally, but recommended,
|
|
||||||
# declare the Python requirements required to build your documentation
|
|
||||||
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
|
|
||||||
# python:
|
|
||||||
# install:
|
|
||||||
# - requirements: docs/requirements.txt
|
|
||||||
|
|
@@ -4,8 +4,8 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
// Local Namespaces
|
// Local Namespaces
|
||||||
using Watcher.Data;
|
using Watcher.Data;
|
||||||
using Watcher.Models;
|
|
||||||
using Watcher.ViewModels;
|
using Watcher.ViewModels;
|
||||||
|
using Watcher.Services;
|
||||||
|
|
||||||
namespace Watcher.Controllers
|
namespace Watcher.Controllers
|
||||||
{
|
{
|
||||||
@@ -18,11 +18,16 @@ namespace Watcher.Controllers
|
|||||||
// Logging einbinden
|
// Logging einbinden
|
||||||
private readonly ILogger<HomeController> _logger;
|
private readonly ILogger<HomeController> _logger;
|
||||||
|
|
||||||
|
// Daten der Backgroundchecks abrufen
|
||||||
|
private IDashboardStore _DashboardStore;
|
||||||
|
|
||||||
// HomeController Constructor
|
// HomeController Constructor
|
||||||
public HomeController(AppDbContext context, ILogger<HomeController> logger)
|
public HomeController(AppDbContext context, ILogger<HomeController> logger, IDashboardStore dashboardStore)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
|
_DashboardStore = dashboardStore;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Dashboard unter /home/index
|
// Dashboard unter /home/index
|
||||||
@@ -52,9 +57,11 @@ namespace Watcher.Controllers
|
|||||||
.ToListAsync(),
|
.ToListAsync(),
|
||||||
Containers = await _context.Containers
|
Containers = await _context.Containers
|
||||||
.OrderBy(s => s.Name)
|
.OrderBy(s => s.Name)
|
||||||
.ToListAsync()
|
.ToListAsync(),
|
||||||
|
NetworkStatus = _DashboardStore.NetworkStatus,
|
||||||
|
DatabaseStatus = _DashboardStore.DatabaseStatus
|
||||||
};
|
};
|
||||||
|
//ViewBag.NetworkConnection = _NetworkCheckStore.NetworkStatus;
|
||||||
return View(viewModel);
|
return View(viewModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,11 +89,18 @@ namespace Watcher.Controllers
|
|||||||
.ToListAsync(),
|
.ToListAsync(),
|
||||||
Containers = await _context.Containers
|
Containers = await _context.Containers
|
||||||
.OrderBy(s => s.Name)
|
.OrderBy(s => s.Name)
|
||||||
.ToListAsync()
|
.ToListAsync(),
|
||||||
|
NetworkStatus = _DashboardStore.NetworkStatus,
|
||||||
|
DatabaseStatus = _DashboardStore.DatabaseStatus
|
||||||
};
|
};
|
||||||
|
|
||||||
return PartialView("_DashboardStats", model);
|
return PartialView("_DashboardStats", model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String ReturnNetworkStatus()
|
||||||
|
{
|
||||||
|
return "OK";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -55,26 +55,26 @@ public class MetricDto
|
|||||||
|
|
||||||
public double GPU_Temp { get; set; } // deg C
|
public double GPU_Temp { get; set; } // deg C
|
||||||
|
|
||||||
public double GPU_Vram_Size { get; set; } // GB
|
public double GPU_Vram_Size { get; set; } // Bytes
|
||||||
|
|
||||||
public double GPU_Vram_Usage { get; set; } // %
|
public double GPU_Vram_Load { get; set; } // %
|
||||||
|
|
||||||
// RAM
|
// RAM
|
||||||
public double RAM_Size { get; set; } // GB
|
public double RAM_Size { get; set; } // Bytes
|
||||||
|
|
||||||
public double RAM_Load { get; set; } // %
|
public double RAM_Load { get; set; } // %
|
||||||
|
|
||||||
// Disks
|
// Disks
|
||||||
public double DISK_Size { get; set; } // GB
|
public double DISK_Size { get; set; } // Bytes
|
||||||
|
|
||||||
public double DISK_Usage { get; set; } // %
|
public double DISK_Usage { get; set; } // Bytes
|
||||||
|
|
||||||
public double DISK_Temp { get; set; } // deg C
|
public double DISK_Temp { get; set; } // deg C (if available)
|
||||||
|
|
||||||
// Network
|
// Network
|
||||||
public double NET_In { get; set; } // Bit
|
public double NET_In { get; set; } // Bytes/s
|
||||||
|
|
||||||
public double NET_Out { get; set; } // Bit
|
public double NET_Out { get; set; } // Bytes/s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -173,26 +173,28 @@ public class MonitoringController : Controller
|
|||||||
|
|
||||||
if (server != null)
|
if (server != null)
|
||||||
{
|
{
|
||||||
|
// neues Metric-Objekt erstellen
|
||||||
var NewMetric = new Metric
|
var NewMetric = new Metric
|
||||||
{
|
{
|
||||||
Timestamp = DateTime.UtcNow,
|
Timestamp = DateTime.UtcNow,
|
||||||
ServerId = dto.ServerId,
|
ServerId = dto.ServerId,
|
||||||
CPU_Load = dto.CPU_Load,
|
CPU_Load = sanitizeInput(dto.CPU_Load),
|
||||||
CPU_Temp = dto.CPU_Temp,
|
CPU_Temp = sanitizeInput(dto.CPU_Temp),
|
||||||
GPU_Load = dto.GPU_Load,
|
GPU_Load = sanitizeInput(dto.GPU_Load),
|
||||||
GPU_Temp = dto.GPU_Temp,
|
GPU_Temp = sanitizeInput(dto.GPU_Temp),
|
||||||
GPU_Vram_Size = dto.GPU_Vram_Size,
|
GPU_Vram_Size = calculateGigabyte(dto.GPU_Vram_Size),
|
||||||
GPU_Vram_Usage = dto.GPU_Vram_Usage,
|
GPU_Vram_Usage = sanitizeInput(dto.GPU_Vram_Load),
|
||||||
RAM_Load = dto.RAM_Load,
|
RAM_Load = sanitizeInput(dto.RAM_Load),
|
||||||
RAM_Size = dto.RAM_Size,
|
RAM_Size = calculateGigabyte(dto.RAM_Size),
|
||||||
DISK_Size = dto.RAM_Size,
|
DISK_Size = calculateGigabyte(dto.DISK_Size),
|
||||||
DISK_Usage = dto.DISK_Usage,
|
DISK_Usage = calculateGigabyte(dto.DISK_Usage),
|
||||||
DISK_Temp = dto.DISK_Temp,
|
DISK_Temp = sanitizeInput(dto.DISK_Temp),
|
||||||
NET_In = dto.NET_In,
|
NET_In = calculateMegabit(dto.NET_In),
|
||||||
NET_Out = dto.NET_Out
|
NET_Out = calculateMegabit(dto.NET_Out)
|
||||||
};
|
};
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// Metric Objekt in Datenbank einfügen
|
||||||
_context.Metrics.Add(NewMetric);
|
_context.Metrics.Add(NewMetric);
|
||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
|
|
||||||
@@ -281,4 +283,40 @@ public class MonitoringController : Controller
|
|||||||
|
|
||||||
return Ok(data);
|
return Ok(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Metric Input Byte zu Gigabyte umwandeln
|
||||||
|
public static double calculateGigabyte(double metric_input)
|
||||||
|
{
|
||||||
|
// *10^-9 um auf Gigabyte zu kommen
|
||||||
|
double calculatedValue = metric_input * Math.Pow(10, -9);
|
||||||
|
|
||||||
|
// Auf 2 Nachkommastellen runden
|
||||||
|
double calculatedValue_s = sanitizeInput(calculatedValue);
|
||||||
|
|
||||||
|
return calculatedValue_s;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Metric Input Byte/s zu Megabit/s umrechnen
|
||||||
|
//TODO
|
||||||
|
public static double calculateMegabit(double metric_input)
|
||||||
|
{
|
||||||
|
// *10^-9 um auf Gigabyte zu kommen
|
||||||
|
double calculatedValue = metric_input * Math.Pow(10, -9);
|
||||||
|
|
||||||
|
// Auf 2 Nachkommastellen runden
|
||||||
|
double calculatedValue_s = sanitizeInput(calculatedValue);
|
||||||
|
|
||||||
|
return calculatedValue_s;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Degree Input auf zwei Nachkommastellen runden
|
||||||
|
public static double sanitizeInput(double metric_input)
|
||||||
|
{
|
||||||
|
Math.Round(metric_input, 2);
|
||||||
|
|
||||||
|
return metric_input;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@@ -5,6 +5,7 @@ using Serilog;
|
|||||||
|
|
||||||
using Watcher.Data;
|
using Watcher.Data;
|
||||||
using Watcher.Models;
|
using Watcher.Models;
|
||||||
|
using Watcher.Services;
|
||||||
//using Watcher.Services;
|
//using Watcher.Services;
|
||||||
//using Watcher.Workers;
|
//using Watcher.Workers;
|
||||||
|
|
||||||
@@ -15,7 +16,7 @@ var builder = WebApplication.CreateBuilder(args);
|
|||||||
// Serilog konfigurieren – nur Logs, die nicht von Microsoft stammen
|
// Serilog konfigurieren – nur Logs, die nicht von Microsoft stammen
|
||||||
Log.Logger = new LoggerConfiguration()
|
Log.Logger = new LoggerConfiguration()
|
||||||
.MinimumLevel.Information()
|
.MinimumLevel.Information()
|
||||||
.MinimumLevel.Override("Microsoft", Serilog.Events.LogEventLevel.Warning) // <--
|
.MinimumLevel.Override("Microsoft", Serilog.Events.LogEventLevel.Warning)
|
||||||
.Enrich.FromLogContext()
|
.Enrich.FromLogContext()
|
||||||
.WriteTo.File(
|
.WriteTo.File(
|
||||||
"logs/watcher-.log",
|
"logs/watcher-.log",
|
||||||
@@ -33,6 +34,13 @@ builder.Services.AddControllersWithViews();
|
|||||||
// HttpContentAccessor
|
// HttpContentAccessor
|
||||||
builder.Services.AddHttpContextAccessor();
|
builder.Services.AddHttpContextAccessor();
|
||||||
|
|
||||||
|
// Storage Singleton
|
||||||
|
builder.Services.AddSingleton<IDashboardStore, DashboardStore>();
|
||||||
|
|
||||||
|
// Background Services
|
||||||
|
builder.Services.AddHostedService<NetworkCheck>();
|
||||||
|
builder.Services.AddHostedService<DatabaseCheck>();
|
||||||
|
|
||||||
|
|
||||||
// ---------- Konfiguration ----------
|
// ---------- Konfiguration ----------
|
||||||
DotNetEnv.Env.Load();
|
DotNetEnv.Env.Load();
|
||||||
@@ -214,4 +222,4 @@ app.MapControllerRoute(
|
|||||||
pattern: "{controller=Home}/{action=Index}/{id?}"
|
pattern: "{controller=Home}/{action=Index}/{id?}"
|
||||||
);
|
);
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
8
Watcher/Services/DashboardStore.cs
Normal file
8
Watcher/Services/DashboardStore.cs
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
namespace Watcher.Services;
|
||||||
|
|
||||||
|
public class DashboardStore : IDashboardStore
|
||||||
|
{
|
||||||
|
public String? NetworkStatus { get; set; }
|
||||||
|
|
||||||
|
public String? DatabaseStatus { get; set; }
|
||||||
|
}
|
67
Watcher/Services/DatabaseCheck.cs
Normal file
67
Watcher/Services/DatabaseCheck.cs
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
using Microsoft.Data.Sqlite;
|
||||||
|
|
||||||
|
namespace Watcher.Services;
|
||||||
|
|
||||||
|
public class DatabaseCheck : BackgroundService
|
||||||
|
{
|
||||||
|
private readonly ILogger<DatabaseCheck> _logger;
|
||||||
|
|
||||||
|
private IDashboardStore _dashboardStore;
|
||||||
|
|
||||||
|
public DatabaseCheck(ILogger<DatabaseCheck> logger, IDashboardStore dashboardStore)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_dashboardStore = dashboardStore;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
|
{
|
||||||
|
var timer = new PeriodicTimer(TimeSpan.FromSeconds(30));
|
||||||
|
|
||||||
|
while (await timer.WaitForNextTickAsync(stoppingToken))
|
||||||
|
{
|
||||||
|
// Hintergrundprozess abwarten
|
||||||
|
await checkDatabaseIntegrity();
|
||||||
|
// 5 Sekdunden Offset
|
||||||
|
await Task.Delay(TimeSpan.FromSeconds(5), stoppingToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// String sqliteConnectionString als Argument übergeben
|
||||||
|
public Task checkDatabaseIntegrity()
|
||||||
|
{
|
||||||
|
using var conn = new SqliteConnection("Data Source=./persistence/watcher.db");
|
||||||
|
_logger.LogInformation("Sqlite Integrity-Check started...");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
using var command = conn.CreateCommand();
|
||||||
|
command.CommandText = """
|
||||||
|
SELECT integrity_check FROM pragma_integrity_check;
|
||||||
|
""";
|
||||||
|
|
||||||
|
using var reader = command.ExecuteReader();
|
||||||
|
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
string status = reader.GetString(0);
|
||||||
|
_dashboardStore.DatabaseStatus = status;
|
||||||
|
_logger.LogInformation("Sqlite DatabaseIntegrity: ${status}", status);
|
||||||
|
}
|
||||||
|
|
||||||
|
conn.Close();
|
||||||
|
}
|
||||||
|
catch (SqliteException e)
|
||||||
|
{
|
||||||
|
conn.Close();
|
||||||
|
_logger.LogError(e.Message);
|
||||||
|
|
||||||
|
// TODO: LogEvent erstellen
|
||||||
|
}
|
||||||
|
|
||||||
|
_logger.LogInformation("Database Integrity-Check finished.");
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
7
Watcher/Services/IDashboardStore.cs
Normal file
7
Watcher/Services/IDashboardStore.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace Watcher.Services;
|
||||||
|
|
||||||
|
public interface IDashboardStore
|
||||||
|
{
|
||||||
|
String? NetworkStatus { get; set; }
|
||||||
|
String? DatabaseStatus { get; set; }
|
||||||
|
}
|
59
Watcher/Services/NetworkCheck.cs
Normal file
59
Watcher/Services/NetworkCheck.cs
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
using System.Net.NetworkInformation;
|
||||||
|
|
||||||
|
namespace Watcher.Services;
|
||||||
|
public class NetworkCheck : BackgroundService
|
||||||
|
{
|
||||||
|
private readonly ILogger<NetworkCheck> _logger;
|
||||||
|
|
||||||
|
private IDashboardStore _DashboardStore;
|
||||||
|
|
||||||
|
public NetworkCheck(ILogger<NetworkCheck> logger, IDashboardStore DashboardStore)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_DashboardStore = DashboardStore;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||||
|
{
|
||||||
|
var timer = new PeriodicTimer(TimeSpan.FromSeconds(30));
|
||||||
|
|
||||||
|
while (await timer.WaitForNextTickAsync(stoppingToken))
|
||||||
|
{
|
||||||
|
// Hintergrundprozess abwarten
|
||||||
|
await checkConnectionAsync();
|
||||||
|
|
||||||
|
// 5 Sekdunden Offset
|
||||||
|
await Task.Delay(TimeSpan.FromSeconds(5), stoppingToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task checkConnectionAsync()
|
||||||
|
{
|
||||||
|
_logger.LogInformation("Networkcheck started.");
|
||||||
|
|
||||||
|
string host = "8.8.8.8";
|
||||||
|
Ping p = new Ping();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
PingReply reply = p.Send(host, 3000);
|
||||||
|
if (reply.Status == IPStatus.Success)
|
||||||
|
{
|
||||||
|
_DashboardStore.NetworkStatus = "online";
|
||||||
|
_logger.LogInformation("Ping successfull. Watcher is online.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
_DashboardStore.NetworkStatus = "offline";
|
||||||
|
_logger.LogError("Ping failed. Watcher appears to have no network connection.");
|
||||||
|
|
||||||
|
// LogEvent erstellen
|
||||||
|
}
|
||||||
|
|
||||||
|
_logger.LogInformation("Networkcheck finished.");
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
@@ -14,5 +14,8 @@ namespace Watcher.ViewModels
|
|||||||
public List<LogEvent> RecentEvents { get; set; } = new();
|
public List<LogEvent> RecentEvents { get; set; } = new();
|
||||||
public List<Container> Containers { get; set; } = new();
|
public List<Container> Containers { get; set; } = new();
|
||||||
|
|
||||||
|
public String? NetworkStatus { get; set; } = "?";
|
||||||
|
public String? DatabaseStatus { get; set; } = "?";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
@using Microsoft.IdentityModel.Tokens
|
||||||
@model Watcher.ViewModels.DashboardViewModel
|
@model Watcher.ViewModels.DashboardViewModel
|
||||||
|
|
||||||
@{
|
@{
|
||||||
@@ -57,18 +58,54 @@
|
|||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="fw-bold mb-3"><i class="bi bi-heart-pulse me-2 text-danger"></i>Systemstatus</h5>
|
<h5 class="fw-bold mb-3"><i class="bi bi-heart-pulse me-2 text-danger"></i>Systemstatus</h5>
|
||||||
|
|
||||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
@if (!Model.NetworkStatus.IsNullOrEmpty())
|
||||||
<span>Netzwerk</span>
|
{
|
||||||
<span class="badge bg-success">OK</span>
|
@if (Model.NetworkStatus == "online")
|
||||||
</div>
|
{
|
||||||
<div class="progress mb-3" style="height: 6px;">
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
<div class="progress-bar bg-success w-100"></div>
|
<span>Netzwerk</span>
|
||||||
</div>
|
<span class="badge bg-success">@Model.NetworkStatus</span>
|
||||||
|
</div>
|
||||||
|
<div class="progress mb-3" style="height: 6px;">
|
||||||
|
<div class="progress-bar bg-success w-100"></div>
|
||||||
|
</div>
|
||||||
|
} else if (Model.NetworkStatus == "offline")
|
||||||
|
{
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
|
<span>Netzwerk</span>
|
||||||
|
<span class="badge bg-danger">@Model.NetworkStatus</span>
|
||||||
|
</div>
|
||||||
|
<div class="progress mb-3" style="height: 6px;">
|
||||||
|
<div class="progress-bar bg-danger w-100"></div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
@if (!Model.DatabaseStatus.IsNullOrEmpty())
|
||||||
<span>Datenbank</span>
|
{
|
||||||
<span class="badge bg-success">OK</span>
|
@if (Model.DatabaseStatus == "ok")
|
||||||
</div>
|
{
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
|
<span>Datenbank</span>
|
||||||
|
<span class="badge bg-success">healthy</span>
|
||||||
|
</div>
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
|
<span>Datenbank</span>
|
||||||
|
<span class="badge bg-danger">unhealthy</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||||
|
<span>Datenbank</span>
|
||||||
|
|
||||||
|
<span class="badge bg-primary">Missing Data</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
<div class="progress mb-3" style="height: 6px;">
|
<div class="progress mb-3" style="height: 6px;">
|
||||||
<div class="progress-bar bg-success w-100"></div>
|
<div class="progress-bar bg-success w-100"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -97,6 +134,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Services -->
|
<!-- Services -->
|
||||||
|
<!-- TODO
|
||||||
<div class="col-12 col-lg-6">
|
<div class="col-12 col-lg-6">
|
||||||
<div class="card shadow rounded-3 p-4 h-100">
|
<div class="card shadow rounded-3 p-4 h-100">
|
||||||
<h2 class="h5 fw-semibold mb-3">Services</h2>
|
<h2 class="h5 fw-semibold mb-3">Services</h2>
|
||||||
@@ -113,20 +151,22 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
<!-- Server Liste -->
|
<!-- Server Liste -->
|
||||||
|
<!-- TODO
|
||||||
<div class="col-12 col-lg-6">
|
<div class="col-12 col-lg-6">
|
||||||
<div class="card shadow rounded-3 p-4 h-100">
|
<div class="card shadow rounded-3 p-4 h-100">
|
||||||
<h2 class="h5 fw-semibold mb-3">Server</h2>
|
<h2 class="h5 fw-semibold mb-3">Server</h2>
|
||||||
<ul class="list-group list-group-flush">
|
<ul class="list-group list-group-flush">
|
||||||
@foreach (var server in Model.Servers)
|
@foreach (Server server in Model.Servers)
|
||||||
{
|
{
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center serverlist">
|
<li class="list-group-item d-flex justify-content-between align-items-center serverlist">
|
||||||
<span>@server.Name</span>
|
<span>@server.Name</span>
|
||||||
<span class="badge bg-info")">
|
<span class="badge bg-info" )">
|
||||||
CPU: 30.45%
|
CPU:
|
||||||
</span>
|
</span>
|
||||||
<span class="badge bg-info")">
|
<span class="badge bg-info" )">
|
||||||
RAM: 65.09%
|
RAM: 65.09%
|
||||||
</span>
|
</span>
|
||||||
<span class="badge @(server.IsOnline ? "bg-success" : "bg-danger")">
|
<span class="badge @(server.IsOnline ? "bg-success" : "bg-danger")">
|
||||||
@@ -136,6 +176,7 @@
|
|||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
Binary file not shown.
Reference in New Issue
Block a user