librelad 62f7a84126 feat(webui): Admin System page with gauges, trend charts & per-app stats
New 'System' admin page (sidebar Tools group) rendering the metrics the
collector now produces:
- live ring gauges for CPU, memory, disk and load
- SVG trend charts (CPU/mem/disk/network) with 1h/6h/24h range toggle
- host info + swap + docker summary strips
- per-app table: CPU/mem bars, network, status, CPU sparkline

Charts are hand-rolled SVG in charts.js (LPCharts) — no third-party libs or
CDN calls — themed entirely from the active theme's CSS variables. The
Overview System card now links here.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-24 16:47:20 +01:00

317 lines
7.8 KiB
CSS

/* Admin area — Overview board + shared admin-page chrome. Visually aligned
with the backup dashboard (tile/card style) and the config page header. */
.admin-page {
padding: 4px 2px 40px;
}
.admin-breadcrumb {
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.06em;
text-transform: uppercase;
color: rgba(var(--text-rgb), 0.45);
margin-bottom: 2px;
}
/* Overview cards */
.admin-card-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 16px;
margin-top: 8px;
}
.admin-card {
display: flex;
flex-direction: column;
padding: 16px;
border: 1px solid rgba(var(--text-rgb), 0.10);
border-radius: 12px;
background: var(--card-bg);
}
.admin-card-head {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
.admin-card-title {
font-size: 0.95rem;
font-weight: 700;
}
.admin-status-dot {
width: 10px;
height: 10px;
border-radius: 50%;
flex-shrink: 0;
}
.admin-status-dot.ok { background: #36d399; }
.admin-status-dot.warn { background: #fbbd23; }
.admin-status-dot.none { background: rgba(var(--text-rgb), 0.25); }
.admin-card-body {
display: flex;
flex-direction: column;
gap: 6px;
flex: 1;
}
.admin-card-line {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 12px;
font-size: 0.85rem;
color: rgba(var(--text-rgb), 0.6);
}
.admin-card-line strong {
color: var(--text-primary);
font-weight: 600;
text-align: right;
word-break: break-word;
}
.admin-card-actions {
margin-top: 14px;
padding-top: 12px;
border-top: 1px solid rgba(var(--text-rgb), 0.08);
}
.admin-card-ok {
font-size: 0.82rem;
color: rgba(var(--text-rgb), 0.55);
}
/* Small entry point on the user Dashboard that links into the Admin area. */
.dashboard-admin-link {
display: inline-flex;
align-items: center;
gap: 6px;
margin: 4px 0 0;
font-size: 0.85rem;
font-weight: 600;
color: var(--accent);
text-decoration: none;
}
.dashboard-admin-link:hover { text-decoration: underline; }
/* ============================================================
Admin → System (in-depth statistics page)
============================================================ */
.sys-section-head {
display: flex;
align-items: center;
justify-content: space-between;
margin: 26px 0 12px;
}
.sys-section-head h2 {
font-size: 1.05rem;
font-weight: 700;
margin: 0;
}
.sys-chart-meta {
font-size: 0.78rem;
color: rgba(var(--text-rgb), 0.5);
}
/* Range selector (1h / 6h / 24h) */
.sys-range { display: inline-flex; gap: 4px; }
.sys-range-btn {
padding: 4px 12px;
font-size: 0.78rem;
font-weight: 600;
color: rgba(var(--text-rgb), 0.7);
background: rgba(var(--text-rgb), 0.06);
border: 1px solid rgba(var(--text-rgb), 0.12);
border-radius: 999px;
cursor: pointer;
transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.sys-range-btn:hover { background: rgba(var(--accent-rgb), 0.15); }
.sys-range-btn.active {
color: var(--text-primary);
background: rgba(var(--accent-rgb), 0.22);
border-color: rgba(var(--accent-rgb), 0.55);
}
/* Gauges row */
.sys-gauges {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 16px;
margin-top: 10px;
}
.lp-gauge {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
padding: 14px 12px 10px;
background: var(--card-bg);
border: 1px solid rgba(var(--text-rgb), 0.10);
border-radius: 12px;
}
.lp-gauge-svg { width: 116px; height: 116px; display: block; }
.lp-gauge-center {
position: absolute;
top: 72px;
left: 0; right: 0;
transform: translateY(-50%);
text-align: center;
pointer-events: none;
}
.lp-gauge-value {
font-size: 1.5rem;
font-weight: 700;
color: var(--text-primary);
line-height: 1;
}
.lp-gauge-value span { font-size: 0.8rem; font-weight: 600; opacity: 0.6; margin-left: 1px; }
.lp-gauge-sub { font-size: 0.68rem; color: rgba(var(--text-rgb), 0.5); margin-top: 3px; }
.lp-gauge-label {
margin-top: 6px;
font-size: 0.82rem;
font-weight: 600;
color: rgba(var(--text-rgb), 0.75);
}
/* Trend chart cards */
.sys-charts {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 16px;
}
.sys-chart-card {
background: var(--card-bg);
border: 1px solid rgba(var(--text-rgb), 0.10);
border-radius: 12px;
padding: 14px 16px 10px;
}
.sys-chart-head {
display: flex;
align-items: baseline;
justify-content: space-between;
font-size: 0.88rem;
font-weight: 700;
margin-bottom: 8px;
}
.sys-chart-head .sys-chart-meta { font-weight: 500; }
.sys-chart-body { position: relative; }
.lp-chart { width: 100%; height: 92px; display: block; overflow: visible; }
.lp-chart-last {
position: absolute;
top: 0; right: 0;
font-size: 0.85rem;
font-weight: 700;
}
.lp-chart-empty {
height: 92px;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.82rem;
color: rgba(var(--text-rgb), 0.4);
}
.sys-net-legend {
display: flex;
gap: 16px;
margin-top: 6px;
font-size: 0.8rem;
color: rgba(var(--text-rgb), 0.7);
}
.sys-net-legend .dot {
display: inline-block;
width: 8px; height: 8px;
border-radius: 50%;
margin-right: 5px;
}
.sys-net-legend .dot.ok { background: var(--status-success); }
.sys-net-legend .dot.accent { background: var(--accent); }
/* Info / docker stat strips */
.sys-strip {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 12px;
}
.sys-stat {
display: flex;
flex-direction: column;
gap: 3px;
padding: 12px 14px;
background: var(--card-bg);
border: 1px solid rgba(var(--text-rgb), 0.10);
border-radius: 10px;
}
.sys-stat-label {
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.04em;
color: rgba(var(--text-rgb), 0.45);
}
.sys-stat-value {
font-size: 0.92rem;
font-weight: 600;
color: var(--text-primary);
word-break: break-word;
}
/* Per-app table */
.sys-apps-wrap {
background: var(--card-bg);
border: 1px solid rgba(var(--text-rgb), 0.10);
border-radius: 12px;
overflow: hidden;
}
table.sys-apps {
width: 100%;
border-collapse: collapse;
font-size: 0.85rem;
}
table.sys-apps th {
text-align: left;
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.04em;
color: rgba(var(--text-rgb), 0.45);
padding: 12px 14px;
border-bottom: 1px solid rgba(var(--text-rgb), 0.10);
}
table.sys-apps td {
padding: 11px 14px;
border-bottom: 1px solid rgba(var(--text-rgb), 0.06);
vertical-align: middle;
color: var(--text-primary);
}
table.sys-apps tr:last-child td { border-bottom: none; }
table.sys-apps tr:hover td { background: rgba(var(--text-rgb), 0.03); }
.sys-app-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sys-app-sub { font-size: 0.72rem; font-weight: 500; color: rgba(var(--text-rgb), 0.45); }
.sys-cell-val { font-size: 0.78rem; color: rgba(var(--text-rgb), 0.65); margin-left: 2px; }
.sys-net-cell { font-size: 0.78rem; color: rgba(var(--text-rgb), 0.7); white-space: nowrap; }
.sys-spark-cell { width: 110px; }
.sys-apps-empty {
text-align: center;
color: rgba(var(--text-rgb), 0.45);
padding: 24px 14px !important;
}
/* Bars + sparklines (shared by LPCharts) */
.lp-bar {
display: inline-block;
width: 90px;
max-width: 40%;
height: 6px;
border-radius: 3px;
background: rgba(var(--text-rgb), 0.12);
overflow: hidden;
vertical-align: middle;
}
.lp-bar-fill { display: block; height: 100%; border-radius: 3px; transition: width .4s ease; }
.lp-spark { width: 100px; height: 24px; display: block; }