refactor: optimize log handling in Proxmox Firewall view by consolidating log data into a static variable, improving data management and preventing potential conflicts

This commit is contained in:
2025-12-02 16:03:22 -05:00
parent 64ae207a76
commit 152a753cf2

View File

@@ -321,15 +321,14 @@
@endif
@if(count($firewallLogs) > 0)
@php
$logsDataId = 'firewall_logs_' . uniqid();
@endphp
<script>
window.{{ $logsDataId }} = @js($firewallLogs);
if (!window.firewallLogsStatic) {
window.firewallLogsStatic = @js($firewallLogs);
}
</script>
<div
x-data="{
logs: window.{{ $logsDataId }} || [],
logs: window.firewallLogsStatic || [],
searchTerm: '',
sortField: 'timestamp_iso',
sortDirection: 'desc',