fix: use unix timestamp for cache busting, generic server icon for Other category

- Replace hardcoded date version strings with dynamic timestamps:
  overview.tpl uses {$smarty.now}, hooks.php uses time(), AdminHTML uses
  $cacheV = time() in heredoc
- Other category gets a gray server/terminal SVG icon instead of falling
  through to the OS-specific letter badge

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Prophet731
2026-03-19 14:15:49 -05:00
parent 64dcce3d0e
commit 504d2926a4
4 changed files with 12 additions and 6 deletions

View File

@@ -135,8 +135,8 @@ add_hook('ClientAreaFooterOutput', 1, function ($vars) {
$systemUrl = Database::getSystemUrl(); $systemUrl = Database::getSystemUrl();
return " return "
<link href=\"" . htmlspecialchars($systemUrl, ENT_QUOTES, 'UTF-8') . "modules/servers/VirtFusionDirect/templates/css/module.css?v=20260319\" rel=\"stylesheet\"> <link href=\"" . htmlspecialchars($systemUrl, ENT_QUOTES, 'UTF-8') . "modules/servers/VirtFusionDirect/templates/css/module.css?v=" . time() . "\" rel=\"stylesheet\">
<script src=\"" . htmlspecialchars($systemUrl, ENT_QUOTES, 'UTF-8') . "modules/servers/VirtFusionDirect/templates/js/keygen.js?v=20260319\"></script> <script src=\"" . htmlspecialchars($systemUrl, ENT_QUOTES, 'UTF-8') . "modules/servers/VirtFusionDirect/templates/js/keygen.js?v=" . time() . "\"></script>
<script> <script>
document.addEventListener('DOMContentLoaded', function() { document.addEventListener('DOMContentLoaded', function() {
var osGalleryData = " . json_encode($galleryData, JSON_THROW_ON_ERROR | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT) . "; var osGalleryData = " . json_encode($galleryData, JSON_THROW_ON_ERROR | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT) . ";
@@ -193,6 +193,9 @@ add_hook('ClientAreaFooterOutput', 1, function ($vars) {
catImg.alt = ''; catImg.alt = '';
catImg.onerror = function() { this.parentNode.style.background = catColor; this.parentNode.textContent = (cat.name || '?')[0].toUpperCase(); }; catImg.onerror = function() { this.parentNode.style.background = catColor; this.parentNode.textContent = (cat.name || '?')[0].toUpperCase(); };
catIcon.appendChild(catImg); catIcon.appendChild(catImg);
} else if (cat.name === 'Other') {
catIcon.style.background = '#6c757d';
catIcon.innerHTML = '<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"#fff\"><path d=\"M3 2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H3zm1 2h8v2H4V4zm0 3h8v1H4V7zm0 2h5v1H4V9z\"/></svg>';
} else { } else {
catIcon.style.background = catColor; catIcon.style.background = catColor;
catIcon.textContent = (cat.name || '?')[0].toUpperCase(); catIcon.textContent = (cat.name || '?')[0].toUpperCase();

View File

@@ -34,9 +34,10 @@ EOT;
public static function serverInfo($systemUrl, $serviceId) public static function serverInfo($systemUrl, $serviceId)
{ {
$systemUrl = htmlspecialchars($systemUrl, ENT_QUOTES, 'UTF-8'); $systemUrl = htmlspecialchars($systemUrl, ENT_QUOTES, 'UTF-8');
$cacheV = time();
return <<<EOT return <<<EOT
<link href="${systemUrl}modules/servers/VirtFusionDirect/templates/css/module.css?v=20260319" rel="stylesheet"> <link href="${systemUrl}modules/servers/VirtFusionDirect/templates/css/module.css?v=${cacheV}" rel="stylesheet">
<script src="${systemUrl}modules/servers/VirtFusionDirect/templates/js/module.js?v=20260319"></script> <script src="${systemUrl}modules/servers/VirtFusionDirect/templates/js/module.js?v=${cacheV}"></script>
<div id="vf-loader" class="vf-loader"> <div id="vf-loader" class="vf-loader">
<div id="vf-loading"></div> <div id="vf-loading"></div>
</div> </div>

View File

@@ -344,6 +344,8 @@ function vfRenderOsGallery(container, data, hiddenInput) {
$(this).replaceWith($('<span></span>').text((category.name || "?")[0].toUpperCase())); $(this).replaceWith($('<span></span>').text((category.name || "?")[0].toUpperCase()));
}); });
iconSpan.append(catImg); iconSpan.append(catImg);
} else if (category.name === "Other") {
iconSpan.css("background", "#6c757d").html('<svg width="16" height="16" viewBox="0 0 16 16" fill="#fff"><path d="M3 2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H3zm1 2h8v2H4V4zm0 3h8v1H4V7zm0 2h5v1H4V9z"/></svg>');
} else { } else {
iconSpan.css("background", brandColor).text((category.name || "?")[0].toUpperCase()); iconSpan.css("background", brandColor).text((category.name || "?")[0].toUpperCase());
} }

View File

@@ -1,5 +1,5 @@
<link href="{$systemURL}modules/servers/VirtFusionDirect/templates/css/module.css?v=20260319" rel="stylesheet"> <link href="{$systemURL}modules/servers/VirtFusionDirect/templates/css/module.css?v={$smarty.now}" rel="stylesheet">
<script src="{$systemURL}modules/servers/VirtFusionDirect/templates/js/module.js?v=20260319"></script> <script src="{$systemURL}modules/servers/VirtFusionDirect/templates/js/module.js?v={$smarty.now}"></script>
{if $serviceStatus eq 'Active'} {if $serviceStatus eq 'Active'}