Co-authored-by: blaerf <blaerf@gmx.de> Reviewed-on: https://git.eckertplayground.de/taarly/PHP_AdminTool_Projekt/pulls/12
112 lines
4.3 KiB
PHP
112 lines
4.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* View-Template für das Server-Dashboard.
|
|
*
|
|
* Aufgaben:
|
|
* - Visualisiert den vom SnmpServerStatusService gelieferten Serverstatus.
|
|
* - Zeigt Kennzahlen wie Hostname, Uptime, CPU-Auslastung, RAM-Auslastung
|
|
* und Belegung der Systempartition "C:" an.
|
|
*
|
|
* Erwartete View-Daten:
|
|
* - array<string, mixed> $serverStatus Assoziatives Array mit Statuswerten (hostname, uptime, cpu_usage, memory_usage, disk_usage_c, last_update).
|
|
*/
|
|
|
|
/** @var array<string, mixed> $serverStatus */
|
|
?>
|
|
|
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
|
<h1 class="h3 mb-0 text-gray-800">Server-Dashboard</h1>
|
|
</div>
|
|
|
|
<div class="row">
|
|
|
|
<!-- Hostname -->
|
|
<div class="col-xl-3 col-md-6 mb-4">
|
|
<div class="card border-left-primary shadow h-100 py-2">
|
|
<div class="card-body">
|
|
<div class="row no-gutters align-items-center">
|
|
<div class="col mr-2">
|
|
<div class="text-xs font-weight-bold text-primary text-uppercase mb-1">
|
|
Hostname
|
|
</div>
|
|
<div class="h5 mb-0 font-weight-bold text-gray-800">
|
|
<?php echo htmlspecialchars((string)($serverStatus['hostname'] ?? 'n/a'), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); ?>
|
|
</div>
|
|
</div>
|
|
<div class="col-auto">
|
|
<i class="fas fa-server fa-2x text-gray-300"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Betriebssystem -->
|
|
<div class="col-xl-3 col-md-6 mb-4">
|
|
<div class="card border-left-success shadow h-100 py-2">
|
|
<div class="card-body">
|
|
<div class="row no-gutters align-items-center">
|
|
<div class="col mr-2">
|
|
<div class="text-xs font-weight-bold text-success text-uppercase mb-1">
|
|
Betriebssystem
|
|
</div>
|
|
<div class="h5 mb-0 font-weight-bold text-gray-800">
|
|
<?php echo htmlspecialchars((string)($serverStatus['os'] ?? 'n/a'), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); ?>
|
|
</div>
|
|
</div>
|
|
<div class="col-auto">
|
|
<i class="fas fa-desktop fa-2x text-gray-300"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- CPU-Auslastung -->
|
|
<div class="col-xl-3 col-md-6 mb-4">
|
|
<div class="card border-left-warning shadow h-100 py-2">
|
|
<div class="card-body">
|
|
<div class="row no-gutters align-items-center">
|
|
<div class="col mr-2">
|
|
<div class="text-xs font-weight-bold text-warning text-uppercase mb-1">
|
|
CPU-Auslastung
|
|
</div>
|
|
<div class="h5 mb-0 font-weight-bold text-gray-800">
|
|
<?php echo (int)($serverStatus['cpu_usage'] ?? 0); ?> %
|
|
</div>
|
|
</div>
|
|
<div class="col-auto">
|
|
<i class="fas fa-microchip fa-2x text-gray-300"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- RAM-Auslastung -->
|
|
<div class="col-xl-3 col-md-6 mb-4">
|
|
<div class="card border-left-info shadow h-100 py-2">
|
|
<div class="card-body">
|
|
<div class="row no-gutters align-items-center">
|
|
<div class="col mr-2">
|
|
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
|
|
RAM-Auslastung
|
|
</div>
|
|
<div class="h5 mb-0 font-weight-bold text-gray-800">
|
|
<?php echo (int)($serverStatus['memory_usage'] ?? 0); ?> %
|
|
</div>
|
|
</div>
|
|
<div class="col-auto">
|
|
<i class="fas fa-memory fa-2x text-gray-300"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<!-- Hier kann man du später Charts, weitere Karten usw. anhängen -->
|