From 7b1b017d8ccadebf6ca442770f406264d482d0fb Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sun, 9 Aug 2026 11:08:58 -0400 Subject: [PATCH] Stamp the stylesheet and script with their mtime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A pull changes the files but not their URLs, so a browser kept serving the old stylesheet to new markup — which is how the Monitor AI row lost its layout. --- Plugin/unraid/Varaverk.page | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Plugin/unraid/Varaverk.page b/Plugin/unraid/Varaverk.page index c75725c..f568e0a 100644 --- a/Plugin/unraid/Varaverk.page +++ b/Plugin/unraid/Varaverk.page @@ -138,9 +138,24 @@ if ($_vv_ai) $validTabs[] = 'ai'; if (!in_array($tab, $validTabs)) $tab = 'monitor'; $tabLabels = ['monitor' => 'Monitor', 'scheduler' => 'Scheduler', 'docker' => 'Docker', 'watchdog' => 'Watchdog', 'partnership' => 'Partnership', 'fallback' => 'FallBack', 'arrs' => 'Arrs', 'rsync' => 'Rsync', 'auth' => 'Auth Stack', 'settings' => 'Settings', 'ai' => 'AI']; + +// Cache stamp for the stylesheet and script below. Both are served straight off the plugin +// directory at a path that never changes, so a browser holding an old copy keeps using it after +// a git pull. This page's own markup is generated fresh every request, so the two fall out of +// step: markup from the new commit rendering against a stylesheet from the old one. That is not +// a theoretical failure — it broke the Monitor AI row on 2026-08-09, when placement moved from +// inline spans into the stylesheet and only half of that arrived in the browser. +// +// mtime rather than a hand-bumped version: it changes on exactly the event that matters, a pull +// rewriting the file, and cannot be forgotten. Falling back to time() when the stat fails errs +// toward re-fetching rather than toward the stale copy that caused the problem. +$_vv_asset_rev = []; +foreach (['css/varaverk.css', 'js/varaverk.js'] as $_vv_a) { + $_vv_asset_rev[$_vv_a] = @filemtime(__DIR__ . '/' . $_vv_a) ?: time(); +} ?> - +
@@ -173,4 +188,4 @@ $tabLabels = ['monitor' => 'Monitor', 'scheduler' => 'Scheduler', 'docker' => 'D
- +