Commit 6: Adminbereich (TanStack Router, 8 Menüpunkte, Scan-Logs)

This commit is contained in:
2026-07-19 02:53:04 +02:00
parent b0ff551ca0
commit 2f31996bbb
31 changed files with 1693 additions and 112 deletions

View File

@@ -0,0 +1,18 @@
import { useQuery } from "@tanstack/react-query";
import type { ScanLogEntry } from "@launchpad/shared";
async function fetchLogs(): Promise<ScanLogEntry[]> {
const res = await fetch("/api/logs");
if (!res.ok) {
throw new Error(`Logs konnten nicht geladen werden (HTTP ${res.status})`);
}
return res.json();
}
export function useLogs() {
return useQuery({
queryKey: ["logs"],
queryFn: fetchLogs,
refetchInterval: 5000,
});
}