diff --git a/extensions/Servers/Proxmox/views/statistics.blade.php b/extensions/Servers/Proxmox/views/statistics.blade.php index 99b78fb79..f046dc2fc 100644 --- a/extensions/Servers/Proxmox/views/statistics.blade.php +++ b/extensions/Servers/Proxmox/views/statistics.blade.php @@ -898,30 +898,98 @@ @json($statisticsExportRows) -
-
- -
- Show - - entries - ({{ $this->statistics->total() }} total) + per page
- - @if($this->statistics->hasPages()) -
- {{ $this->statistics->links() }} -
- @endif + {{-- Page info and navigation --}} +
+ + Showing {{ (($this->statistics->currentPage() - 1) * $this->statistics->perPage()) + 1 }} - {{ min($this->statistics->currentPage() * $this->statistics->perPage(), $this->statistics->total()) }} of {{ $this->statistics->total() }} entries + + + @if($this->statistics->hasPages()) +
+ {{-- First page --}} + + + {{-- Previous page --}} + + + {{-- Page numbers --}} + @php + $statsTotalPages = $this->statistics->lastPage(); + $statsCurrentPage = $this->statistics->currentPage(); + $statsStartPage = max(1, $statsCurrentPage - 2); + $statsEndPage = min($statsTotalPages, $statsCurrentPage + 2); + @endphp + + @if($statsStartPage > 1) + + @if($statsStartPage > 2) + ... + @endif + @endif + + @for($i = $statsStartPage; $i <= $statsEndPage; $i++) + + @endfor + + @if($statsEndPage < $statsTotalPages) + @if($statsEndPage < $statsTotalPages - 1) + ... + @endif + + @endif + + {{-- Next page --}} + + + {{-- Last page --}} + +
+ @endif +
-
+ @endif @@ -1322,91 +1390,101 @@ @json($taskHistoryExportRows) -
-
- -
- Show - - entries - ({{ count($this->taskHistory) }} total) + per page
- + {{-- Page info and navigation --}} @php $taskTotalPages = $this->taskHistoryTotalPages; $taskCurrentPage = $taskHistoryCurrentPage; + $taskTotalCount = count($this->taskHistory); @endphp - @if($taskTotalPages > 1) -
- - - - - @php - $pages = []; +
+ + Showing {{ (($taskCurrentPage - 1) * $taskHistoryPerPage) + 1 }} - {{ min($taskCurrentPage * $taskHistoryPerPage, $taskTotalCount) }} of {{ $taskTotalCount }} tasks + + + @if($taskTotalPages > 1) +
+ {{-- First page --}} + - // Always show first page - $pages[] = 1; + {{-- Previous page --}} + - // Calculate range around current page - $start = max(2, $taskCurrentPage - 1); - $end = min($taskTotalPages - 1, $taskCurrentPage + 1); + {{-- Page numbers --}} + @php + $taskStartPage = max(1, $taskCurrentPage - 2); + $taskEndPage = min($taskTotalPages, $taskCurrentPage + 2); + @endphp - // Add ellipsis after first page if needed - if ($start > 2) { - $pages[] = '...'; - } - - // Add pages around current - for ($i = $start; $i <= $end; $i++) { - $pages[] = $i; - } - - // Add ellipsis before last page if needed - if ($end < $taskTotalPages - 1) { - $pages[] = '...'; - } - - // Always show last page if more than 1 page - if ($taskTotalPages > 1) { - $pages[] = $taskTotalPages; - } - @endphp - - @foreach($pages as $page) - @if($page === '...') - ... - @else - + @if($taskStartPage > 1) + + @if($taskStartPage > 2) + ... + @endif @endif - @endforeach - - - -
- @else -
Page 1 of 1
- @endif + + @for($i = $taskStartPage; $i <= $taskEndPage; $i++) + + @endfor + + @if($taskEndPage < $taskTotalPages) + @if($taskEndPage < $taskTotalPages - 1) + ... + @endif + + @endif + + {{-- Next page --}} + + + {{-- Last page --}} + +
+ @endif +
-
+ @endif