From 0f2a342b757a8468c63a7ab245d8131eaea9e841 Mon Sep 17 00:00:00 2001 From: malmert Date: Sun, 1 Mar 2026 18:23:08 +0100 Subject: [PATCH] test database privilige and index + delete ep packets --- frontend/src/api/apiClient.ts | 6 ++++++ frontend/src/components/PacketViewer.tsx | 5 +++-- setup_database.sh | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/frontend/src/api/apiClient.ts b/frontend/src/api/apiClient.ts index d87a512..3a53d06 100644 --- a/frontend/src/api/apiClient.ts +++ b/frontend/src/api/apiClient.ts @@ -159,6 +159,12 @@ export const fetchPackets = async (limit = 100): Promise => { return res.data; }; +export const clearPackets = async (): Promise => { + // limit default mirrors OpenAPI default + const res = await api.delete('/packets/packets'); + return res.data; +}; + /* ------------------------- Firewall ------------------------- */ diff --git a/frontend/src/components/PacketViewer.tsx b/frontend/src/components/PacketViewer.tsx index 0b272f7..356d601 100644 --- a/frontend/src/components/PacketViewer.tsx +++ b/frontend/src/components/PacketViewer.tsx @@ -1,5 +1,5 @@ // src/components/PacketViewer.tsx -import { DownloadOutlined, SyncOutlined } from '@ant-design/icons'; +import { DeleteOutlined, DownloadOutlined, SyncOutlined } from '@ant-design/icons'; import { Button, Card, @@ -17,7 +17,7 @@ import { message, } from 'antd'; import { ReactElement, useCallback, useEffect, useMemo, useRef, useState } from 'react'; -import { fetchPackets } from '../api/apiClient'; +import { clearPackets, fetchPackets } from '../api/apiClient'; const { Text } = Typography; const { Option } = Select; @@ -434,6 +434,7 @@ export default function PacketViewer(): ReactElement { handlePauseToggle(!checked ? true : false)} />