diff --git a/extensions/Servers/Proxmox/Livewire/Firewall.php b/extensions/Servers/Proxmox/Livewire/Firewall.php index 9af206d68..46699001a 100644 --- a/extensions/Servers/Proxmox/Livewire/Firewall.php +++ b/extensions/Servers/Proxmox/Livewire/Firewall.php @@ -851,17 +851,19 @@ class Firewall extends Component $this->firewallLogs = []; + // Store raw log entries without parsing foreach ($rawLogs as $logEntry) { - $logText = null; - if (is_string($logEntry)) { $logText = trim($logEntry); + if (!empty($logText)) { + $this->firewallLogs[] = ['raw' => $logText]; + } } elseif (is_array($logEntry)) { - // Try common field names + // If it's an array, try to get the log text $logText = $logEntry['n'] ?? $logEntry['t'] ?? $logEntry['text'] ?? $logEntry['log'] ?? $logEntry['message'] ?? $logEntry['line'] ?? ''; - // If still empty, try to get the first string value if (empty($logText)) { + // Try to get the first string value foreach ($logEntry as $key => $value) { if (is_string($value) && !empty(trim($value))) { $logText = trim($value); @@ -869,20 +871,15 @@ class Firewall extends Component } } } - } - - if (empty($logText)) { - continue; - } - - $parsed = $this->parseFirewallLog($logText); - if ($parsed) { - $this->firewallLogs[] = $parsed; + + if (!empty($logText)) { + $this->firewallLogs[] = ['raw' => $logText]; + } } } if (empty($this->firewallLogs) && !empty($rawLogs)) { - $this->logError = 'Logs received but could not be parsed. Please check that firewall logging is enabled in Proxmox.'; + $this->logError = 'Logs received but could not be processed.'; } elseif (empty($this->firewallLogs)) { $this->logError = 'No firewall logs available. Ensure firewall logging is enabled in Proxmox (Datacenter > Firewall > Options).'; } diff --git a/extensions/Servers/Proxmox/views/firewall.blade.php b/extensions/Servers/Proxmox/views/firewall.blade.php index fdd371dc0..9badcd5d8 100644 --- a/extensions/Servers/Proxmox/views/firewall.blade.php +++ b/extensions/Servers/Proxmox/views/firewall.blade.php @@ -320,43 +320,13 @@ @if(count($firewallLogs) > 0)
| Timestamp | -Action | -Source | -Destination | -Protocol | -Source Port | -Dest Port | -TTL | -ACK | -
|---|---|---|---|---|---|---|---|---|
| {{ $log['timestamp'] ?? '-' }} | -- - {{ $log['action'] ?? '-' }} - - | -{{ $log['source'] ?? '-' }} |
- {{ $log['destination'] ?? '-' }} |
- {{ $log['proto'] ?? '-' }} | -{{ $log['spt'] ?? '-' }} | -{{ $log['dpt'] ?? '-' }} | -{{ $log['ttl'] ?? '-' }} | -{{ $log['ack'] ?? '-' }} | -
{{ $log['raw'] ?? '' }}
+