diff --git a/extensions/Servers/Proxmox/views/overview.blade.php b/extensions/Servers/Proxmox/views/overview.blade.php index 3bee0599a..8a3a39699 100644 --- a/extensions/Servers/Proxmox/views/overview.blade.php +++ b/extensions/Servers/Proxmox/views/overview.blade.php @@ -772,11 +772,13 @@ - @endif + + +
-
+

@@ -836,23 +838,18 @@
-
-
-
-
-
-
-
-
-
-
-
+ +
+ + + + Connecting to network monitor...
-
+

Notes

@@ -966,7 +963,7 @@ @endif
- +
@once @@ -1212,11 +1209,11 @@ if (networkData.interfaces.length === 0) { container.innerHTML = ` -
- +
+ -

No network data available

+ No network interfaces detected
`; return; @@ -1516,10 +1513,10 @@ const wasEmpty = !networkData || !networkData.interfaces || networkData.interfaces.length === 0; const hasExistingInterfaces = container && container.querySelectorAll('.chart-toggle').length > 0; - // Check if container shows the loading placeholder (skeleton loader) + // Check if container shows the initial placeholder const showsPlaceholder = container && ( - container.querySelector('.animate-pulse') !== null || - container.querySelector('.border-dashed') !== null + container.querySelector('#network-traffic-placeholder') !== null || + container.querySelector('.animate-spin') !== null ); networkData = data; @@ -1527,13 +1524,13 @@ // Store globally for export access window.networkTrafficData = data; - // Render interfaces if: - // 1. This is the first load (wasEmpty && no existing interfaces), OR - // 2. Container shows placeholder (was reset by tab switch), OR - // 3. No existing interfaces found in container + // Render interfaces only if: + // 1. This is the first load (showing placeholder), OR + // 2. No existing interfaces found in container + // Never re-render once we have data - just update values if (data.interfaces && data.interfaces.length > 0) { - if (showsPlaceholder || !hasExistingInterfaces || wasEmpty) { - console.log('Rendering interfaces - showsPlaceholder:', showsPlaceholder, 'hasExistingInterfaces:', hasExistingInterfaces, 'wasEmpty:', wasEmpty); + if (showsPlaceholder || !hasExistingInterfaces) { + console.log('Rendering interfaces - showsPlaceholder:', showsPlaceholder, 'hasExistingInterfaces:', hasExistingInterfaces); // Render immediately - no delay renderInterfaces(); // Also update data immediately after render to ensure values are set @@ -1611,17 +1608,20 @@ } catch (error) { console.error('Failed to fetch live traffic data:', error); const container = document.getElementById('network-traffic-container'); - // Only show error if there's no existing network data (initial load failed) - // Keep existing content if we already have data (refresh failed) - const hasExistingContent = container && container.querySelectorAll('.chart-toggle').length > 0; - if (container && !hasExistingContent) { + // Only show error if still showing initial placeholder (no data loaded yet) + // Never replace existing network data with error state + const showsPlaceholder = container && ( + container.querySelector('#network-traffic-placeholder') !== null || + container.querySelector('.animate-spin') !== null + ); + if (container && showsPlaceholder) { container.innerHTML = ` -
- +
+ -

Failed to load network data

-

${error.message}

+ Failed to load network data +

${error.message}

`; }