From 9d672d58efafc7219498ea24dd441a835e1cd3dd Mon Sep 17 00:00:00 2001 From: "Joseph.Rawlings" Date: Mon, 8 Dec 2025 19:42:25 -0500 Subject: [PATCH] Refactor task history pagination methods for improved clarity and performance --- .../Servers/Proxmox/Livewire/Statistics.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/extensions/Servers/Proxmox/Livewire/Statistics.php b/extensions/Servers/Proxmox/Livewire/Statistics.php index 92b76e30c..80e5d2706 100644 --- a/extensions/Servers/Proxmox/Livewire/Statistics.php +++ b/extensions/Servers/Proxmox/Livewire/Statistics.php @@ -650,20 +650,15 @@ class Statistics extends Component // Task History Pagination Methods // ========================================== - /** - * Get all task history for pagination (raw data) - */ - public function getAllTaskHistoryProperty(): array - { - return $this->taskHistory; - } - /** * Get paginated task history for display */ public function getPaginatedTaskHistoryProperty(): array { - $tasks = $this->allTaskHistory; + $tasks = $this->taskHistory; + if (empty($tasks)) { + return []; + } $offset = ($this->taskHistoryCurrentPage - 1) * $this->taskHistoryPerPage; return array_slice($tasks, $offset, $this->taskHistoryPerPage); @@ -674,7 +669,7 @@ class Statistics extends Component */ public function getTaskHistoryTotalPagesProperty(): int { - $total = count($this->allTaskHistory); + $total = count($this->taskHistory); return max(1, (int) ceil($total / $this->taskHistoryPerPage)); }