refactor: update Proxmox Firewall component to load logs on mount, improving user experience and log visibility

This commit is contained in:
2025-12-02 08:28:02 -05:00
parent 5e3fab7921
commit 2eb67b311b
2 changed files with 2 additions and 4 deletions

View File

@@ -58,7 +58,7 @@ class Firewall extends Component
$this->loadFirewallOptions();
$this->loadFirewallRules();
$this->loadNetworkAdapters();
// Don't load logs on mount - only load when refresh button is clicked
$this->loadFirewallLogs();
}
protected function loadAvailableIps(): void
@@ -937,9 +937,6 @@ class Firewall extends Component
} elseif (empty($this->firewallLogs)) {
$this->logError = 'No firewall logs available. Ensure firewall logging is enabled in Proxmox (Datacenter > Firewall > Options).';
}
// Dispatch event to update frontend without full re-render
$this->dispatch('logs-updated', logs: $this->firewallLogs);
} catch (\Exception $e) {
$errorMessage = $e->getMessage();
if (method_exists($e, 'response') && $e->response()) {

View File

@@ -323,6 +323,7 @@
@if(count($firewallLogs) > 0)
<div
wire:ignore.self
x-data="{
logs: @js($firewallLogs),
searchTerm: '',