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