Plugin: common.php library, watchdog expansion, monitor + scheduler improvements
PHP architecture: - Extract common.php from monitor.php — shared system functions (vv_system_info, vv_memory_breakdown, vv_remote_hosts_stats, disk/GPU/UPS/network/docker/parity, etc.) now live in one place; monitor.php and watchdog.php both require common.php - Add unraid_api.php as explicit include (was implicit via config.php chain) - confform.php: add missing require_once config.php (implicit dep made explicit) - Delete orphaned pages/docs.php and pages/config.php (absorbed into scheduler) Watchdog page: - Add Storage watchdog card (growth + log strikes, baseline age, suppress ceilings) - Add Network watchdog card (NPM strikes, DDNS domain/container, NPM URL) - One host per row layout — all 5 watchdog cards equally spaced via inner grid - Watchdog now uses Unraid API for local system stats; remote nodes with API key but no SSH get system info from vv_remote_hosts_stats() with api_only flag - SSH bundle: /proc/meminfo passed as raw section instead of awk-parsed header fields — fixes RAM showing 0 on remote hosts where awk quoting was unreliable - vv_wd_local_system() rewritten as thin wrapper over vv_system_info() + vv_memory_breakdown() Monitor page: - Watchdog card: add stability strikes, storage watchdog strikes, network NPM status, live system stats (rootfs/log/tmp %, RAM free, load, CPU temp, zombies, NIC, sshd) - Row height: switch from max-height on cards to minmax(0, calc(...)) on grid track — all cards in a row now fill to the tallest card's height correctly (fixes Pools card being shorter than neighbours) Scheduler page: - Add Tools section above Custom Scripts — lists Tools/*.sh with run/dry-run/cron/log - vv_tools_scripts() function in scheduler.php include Tools: - Add docker_prune_images.sh — removes dangling Docker images; --dry-run and --status modes
This commit is contained in:
@@ -15,7 +15,26 @@
|
||||
.vv-wide { flex: 100%; }
|
||||
.vv-card h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase;
|
||||
color: #888; letter-spacing: 0.05em; white-space: normal;
|
||||
overflow: hidden; min-width: 0; }
|
||||
overflow: hidden; min-width: 0;
|
||||
display: flex; align-items: center; justify-content: space-between; }
|
||||
|
||||
/* Cog icon — links to related Unraid page. Hidden until card hovered. */
|
||||
.vv-card-cog { color: #2a2a2a; font-size: 13px; line-height: 1; text-decoration: none;
|
||||
padding: 1px 3px; border-radius: 3px; flex-shrink: 0;
|
||||
transition: color 0.15s, background 0.15s;
|
||||
font-style: normal; font-weight: normal; text-transform: none;
|
||||
letter-spacing: 0; cursor: pointer; }
|
||||
.vv-card:hover .vv-card-cog { color: #4a4a4a; }
|
||||
.vv-card-cog:hover { color: #aaa !important; background: #333; }
|
||||
|
||||
/* Status banner — coloured strip at top of card body */
|
||||
.vv-banner { border-radius: 4px; padding: 5px 10px; margin-bottom: 10px;
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
font-size: 12px; font-weight: 600; }
|
||||
.vv-banner-ok { background: #061306; border: 1px solid #1a401a; color: #4caf50; }
|
||||
.vv-banner-warn { background: #130e00; border: 1px solid #3d2e00; color: #ff9800; }
|
||||
.vv-banner-err { background: #140404; border: 1px solid #3d1010; color: #f44336; }
|
||||
.vv-banner-off { background: #0d0d0d; border: 1px solid #252525; color: #555; }
|
||||
|
||||
/* System card — no h3, no top padding waste */
|
||||
#vv-system { padding-top: 14px; }
|
||||
@@ -118,7 +137,60 @@
|
||||
.vv-nb-settings { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
|
||||
padding: 5px 10px; background: #101010; border-bottom: 1px solid #1a1a1a; }
|
||||
|
||||
/* ── Monitor: locked row height + scrollable cards ────────────────────────── */
|
||||
|
||||
/* Cards on the monitor grid are flex columns — h3 pins, body scrolls */
|
||||
#vv-monitor .vv-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
#vv-monitor .vv-card h3 { flex-shrink: 0; }
|
||||
#vv-monitor .vv-card > div {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
#vv-monitor .vv-card > div::-webkit-scrollbar { display: none; }
|
||||
|
||||
/* Dynamic row heights capped per screen tier — rows size to content, never exceed the cap.
|
||||
minmax(0, Xpx): track is content-driven but capped; align-items:stretch makes all cards
|
||||
in a row fill the track, so short cards (Pools, Watchdog) match tall ones (Array).
|
||||
Breakpoints are viewport height (after browser chrome), not screen height. */
|
||||
|
||||
/* ~720p (viewport ≤ 700px) */
|
||||
@media (min-width: 481px) and (max-height: 700px) {
|
||||
#vv-monitor { grid-auto-rows: minmax(0, calc((100vh - 160px) / 4)); }
|
||||
}
|
||||
/* ~1080p (viewport 701–1100px) */
|
||||
@media (min-width: 481px) and (min-height: 701px) and (max-height: 1100px) {
|
||||
#vv-monitor { grid-auto-rows: minmax(0, calc((100vh - 240px) / 4)); }
|
||||
}
|
||||
/* ~1440p (viewport 1101–1450px) — calibrated on 15" 1440p display */
|
||||
@media (min-width: 481px) and (min-height: 1101px) and (max-height: 1450px) {
|
||||
#vv-monitor { grid-auto-rows: minmax(0, calc((100vh - 335px) / 4)); }
|
||||
}
|
||||
/* ~4K (viewport > 1450px) */
|
||||
@media (min-width: 481px) and (min-height: 1451px) {
|
||||
#vv-monitor { grid-auto-rows: minmax(0, calc((100vh - 500px) / 4)); }
|
||||
}
|
||||
|
||||
/* Mobile: natural heights, let page scroll */
|
||||
@media (max-width: 480px) {
|
||||
#vv-monitor { grid-auto-rows: auto !important; }
|
||||
#vv-monitor .vv-card { overflow: visible !important; }
|
||||
#vv-monitor .vv-card > div { overflow-y: visible; min-height: auto; }
|
||||
}
|
||||
|
||||
/* Monitor responsive — 4-column grid at medium width */
|
||||
@media (max-width: 1400px) {
|
||||
/* CPU core bars — reduce gap/min-width at intermediate widths before cores get clipped */
|
||||
.vv-cpu-cores { gap: 2px !important; }
|
||||
.vv-cpu-core { min-width: 7px !important; }
|
||||
}
|
||||
|
||||
@media (max-width: 1024px) {
|
||||
#vv-monitor { grid-template-columns: repeat(4, 1fr) !important; }
|
||||
#vv-docker { grid-column: span 4 !important; }
|
||||
@@ -166,8 +238,8 @@
|
||||
.vv-snap-media { font-size: 11px; }
|
||||
|
||||
/* CPU core bars — shrink gap and min-width so many cores don't overflow */
|
||||
.vv-cpu-cores { gap: 1px !important; }
|
||||
.vv-cpu-core { min-width: 4px !important; }
|
||||
.vv-cpu-cores { gap: 2px !important; }
|
||||
.vv-cpu-core { min-width: 6px !important; }
|
||||
|
||||
/* Monitor single-column — explicit placement cards need override too */
|
||||
#vv-monitor { grid-template-columns: 1fr !important; }
|
||||
@@ -663,6 +735,7 @@ code.vv-unknown-var { color: #ff9800; background: #1f130d; }
|
||||
.vv-df-vm-meta { font-size: 10px; color: #555; }
|
||||
.vv-df-cols { display: flex; gap: 10px; align-items: flex-start; }
|
||||
.vv-df-col { flex: 1; min-width: 0; }
|
||||
#vv-docker-folders-body { overflow-x: hidden; }
|
||||
.vv-df-folder { border-bottom: 1px solid #1a1a1a; }
|
||||
.vv-df-folder:last-child { border-bottom: none; }
|
||||
.vv-df-folder-hdr { display: flex; align-items: center; gap: 6px; padding: 5px 4px;
|
||||
|
||||
Reference in New Issue
Block a user