diff --git a/frontend/src/pages/settings/Monitoring.tsx b/frontend/src/pages/settings/Monitoring.tsx index e84d59d4..34ea3bf0 100644 --- a/frontend/src/pages/settings/Monitoring.tsx +++ b/frontend/src/pages/settings/Monitoring.tsx @@ -8,7 +8,22 @@ import Button from '../../components/ui/Button'; import Input from '../../components/ui/Input'; import Select from '../../components/ui/Select'; import Modal from '../../components/ui/Modal'; -import { ArrowLeft, Send, RefreshCw, Mail, ShieldAlert, ChevronLeft, ChevronRight, Trash2 } from 'lucide-react'; +import { ArrowLeft, Send, RefreshCw, Mail, ShieldAlert, ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, Trash2 } from 'lucide-react'; + +/** + * Liefert die anzuzeigenden Seitenzahlen für die Pagination. + * Bis zu 10 Seitenzahlen, current möglichst mittig. + */ +function paginationWindow(current: number, total: number, size = 10): number[] { + if (total <= size) return Array.from({ length: total }, (_, i) => i + 1); + let start = Math.max(1, current - Math.floor(size / 2)); + let end = start + size - 1; + if (end > total) { + end = total; + start = end - size + 1; + } + return Array.from({ length: end - start + 1 }, (_, i) => start + i); +} const TYPE_OPTIONS: { value: SecurityEventType | ''; label: string }[] = [ { value: '', label: 'Alle Typen' }, @@ -305,15 +320,56 @@ export default function Monitoring() { )} {pagination && pagination.totalPages > 1 && ( -