From 0b72e7ab12e7697309c9a4a421bb7e2757d50ddb Mon Sep 17 00:00:00 2001 From: "courtmanr@gmail.com" Date: Thu, 1 May 2025 17:02:48 +0100 Subject: [PATCH] fix(ui): Correct guest type check for LXC disk display Ensure LXC containers correctly display disk usage bar by checking for type "CT" instead of "lxc". --- src/public/app.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/public/app.js b/src/public/app.js index 2c8582c60..46b309aaa 100644 --- a/src/public/app.js +++ b/src/public/app.js @@ -1384,17 +1384,13 @@ document.addEventListener('DOMContentLoaded', function() { // REMOVED: diskBarHTML = createProgressTextBarHTML(diskPercent, diskTooltipText, diskColorClass); // --- NEW Conditional Disk Display --- - if (guest.type === 'lxc') { // Assuming type is 'lxc' or 'qemu' (check data structure if needed) + if (guest.type === 'CT') { // Corrected check: Use 'CT' for containers const diskPercent = guest.disk; // Use metric disk usage for LXC const diskTooltipText = guest.diskTotal ? `${formatBytesInt(guest.diskCurrent)} / ${formatBytesInt(guest.diskTotal)} (${diskPercent}%)` : `${diskPercent}%`; const diskColorClass = getUsageColor(diskPercent); diskBarHTML = createProgressTextBarHTML(diskPercent, diskTooltipText, diskColorClass); } else if (guest.type === 'VM') { - // --- DEBUG LOGGING --- - if (guest.name && guest.name.toLowerCase().includes('unraid')) { // Log only for specific VM for clarity - console.log(`[DEBUG] VM Disk Check (${guest.name}): guest.diskTotal =`, guest.diskTotal); - } - // --- END DEBUG LOGGING --- + // REMOVED DEBUG LOGGING if (guest.diskTotal) { // Check if total disk exists and is non-zero // For VMs, show only total size without progress bar const totalDiskFormatted = formatBytesInt(guest.diskTotal);