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:
@@ -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',
|
||||||
|
|||||||
Reference in New Issue
Block a user