From 111adc6260e05eb6e3552c743cb9dcdbab2a258b Mon Sep 17 00:00:00 2001 From: "Joseph.Rawlings" Date: Tue, 2 Dec 2025 16:40:11 -0500 Subject: [PATCH] refactor: update firewall logs loading mechanism to use Alpine.js for improved data handling and user experience --- .../Servers/Proxmox/Livewire/Firewall.php | 22 +++++----- .../Servers/Proxmox/views/firewall.blade.php | 44 +++++++++++++------ 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/extensions/Servers/Proxmox/Livewire/Firewall.php b/extensions/Servers/Proxmox/Livewire/Firewall.php index d6dc9e701..efce7d922 100644 --- a/extensions/Servers/Proxmox/Livewire/Firewall.php +++ b/extensions/Servers/Proxmox/Livewire/Firewall.php @@ -797,25 +797,23 @@ class Firewall extends Component } } - /** - * Public method to load firewall logs - called only once on page load via API - */ - #[\Livewire\Attributes\Computed] - public function firewallLogs() - { - return $this->loadFirewallLogs(); - } - /** * Fetch firewall logs via API call - returns logs as JSON + * This is called only once on page load via Alpine.js */ - public function fetchFirewallLogs(): array + public function fetchFirewallLogs(): void { $this->loadFirewallLogs(); - return [ + $this->dispatch('firewall-logs-loaded', [ 'logs' => $this->firewallLogs, 'error' => $this->logError, - ]; + ]); + } + + #[\Livewire\Attributes\On('fetchFirewallLogsAction')] + public function handleFetchFirewallLogs(): void + { + $this->fetchFirewallLogs(); } public function loadFirewallLogs(): void diff --git a/extensions/Servers/Proxmox/views/firewall.blade.php b/extensions/Servers/Proxmox/views/firewall.blade.php index dd2dc889b..3f953998c 100644 --- a/extensions/Servers/Proxmox/views/firewall.blade.php +++ b/extensions/Servers/Proxmox/views/firewall.blade.php @@ -303,35 +303,51 @@ + +