feat: add explicit event handler for network analysis loading to improve reliability on initial page visits

This commit is contained in:
2025-12-01 07:59:30 -05:00
parent 7307ea9343
commit 774526221c
2 changed files with 28 additions and 34 deletions

View File

@@ -150,6 +150,20 @@ class Statistics extends Component
$this->fetchGraphData('disk', $this->diskTimeRange, $this->diskAggregation);
}
/**
* Explicit event handler for Network Analysis lazy loading.
*
* This mirrors the Live Telemetry pattern (proxmox:stats) and allows the
* frontend to trigger loading via Livewire.dispatch(), which is more
* robust than relying on @this in inline scripts – especially on the
* first-ever load of the Statistics page for a given server.
*/
#[On('proxmox:network-analysis-load')]
public function handleNetworkAnalysisLoad(): void
{
$this->loadNetworkAnalysis();
}
public function loadNetworkAnalysis(): void
{
Log::debug('Network Analysis: loadNetworkAnalysis() called', [