refactor: update Proxmox Firewall component to load logs on mount, improving user experience and log visibility
This commit is contained in:
@@ -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()) {
|
||||
|
||||
@@ -323,6 +323,7 @@
|
||||
|
||||
@if(count($firewallLogs) > 0)
|
||||
<div
|
||||
wire:ignore.self
|
||||
x-data="{
|
||||
logs: @js($firewallLogs),
|
||||
searchTerm: '',
|
||||
|
||||
Reference in New Issue
Block a user