From 55e817d23438421c9fb41e9969d8918d327a7048 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sun, 31 May 2026 22:15:13 -0400 Subject: [PATCH] ui: show last cleanup freed amounts on transcode Ramdisk/NVMe tags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parses the last 'Ramdisk freed' and 'SSD freed' values from the transcode management log and displays them as small ↓XMB annotations inside each tag. Co-Authored-By: Claude Sonnet 4.6 --- Plugin/unraid/include/common.php | 17 +++++++++++++++++ Plugin/unraid/pages/monitor.php | 16 ++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Plugin/unraid/include/common.php b/Plugin/unraid/include/common.php index 6cd59b6..a70579b 100644 --- a/Plugin/unraid/include/common.php +++ b/Plugin/unraid/include/common.php @@ -715,6 +715,21 @@ function vv_transcode_sessions(): array { // Ramdisk disk usage $rd = vv_df('/mnt/ramdisk_transcodes'); + // Last cleanup values from transcode management log + $lastRdFreed = null; + $lastSsdFreed = null; + $logFile = '/var/log/varaverk/Orchestrators/transcode_management.log'; + if (file_exists($logFile)) { + $lines = file($logFile, FILE_IGNORE_NEW_LINES) ?: []; + foreach (array_reverse($lines) as $line) { + if ($lastRdFreed === null && preg_match('/Ramdisk freed:\s*(\S+)/u', $line, $m)) + $lastRdFreed = $m[1]; + if ($lastSsdFreed === null && preg_match('/SSD freed:\s*(\S+)/u', $line, $m)) + $lastSsdFreed = $m[1]; + if ($lastRdFreed !== null && $lastSsdFreed !== null) break; + } + } + return [ 'available' => true, 'current_target' => $target, @@ -726,5 +741,7 @@ function vv_transcode_sessions(): array { 'ssd_sessions' => $ssdSessions, 'ramdisk' => $rd, 'ssd' => $ssd, + 'last_rd_freed' => $lastRdFreed, + 'last_ssd_freed' => $lastSsdFreed, ]; } diff --git a/Plugin/unraid/pages/monitor.php b/Plugin/unraid/pages/monitor.php index a2a75be..1436cb9 100644 --- a/Plugin/unraid/pages/monitor.php +++ b/Plugin/unraid/pages/monitor.php @@ -1342,14 +1342,18 @@ function vvPollMonitor() { `; } - const nvmeColor = ssd.available ? '#4caf50' : '#f44336'; + const nvmeColor = ssd.available ? '#4caf50' : '#f44336'; + const rdFreed = tc.last_rd_freed ?? null; + const ssdFreed = tc.last_ssd_freed ?? null; + const rdCleanTip = rdFreed ? `↓${rdFreed}` : ''; + const ssdCleanTip = ssdFreed ? `↓${ssdFreed}` : ''; document.getElementById('vv-transcode-body').innerHTML = `
-
- ● ${loc} - ● NVMe +
+ ● ${loc}${rdCleanTip} + ● NVMe${ssdCleanTip}
Flips: ${tc.flip_count_hour ?? 0}/hr · ${flipStr}