import { useState } from 'react'; import { useQuery } from '@tanstack/react-query'; import { api } from '@/services/api'; import { cn } from '@/lib/utils'; import { Search, Filter, ChevronLeft, ChevronRight } from 'lucide-react'; export default function Events() { const [page, setPage] = useState(1); const [search, setSearch] = useState(''); const limit = 20; const { data: events, isLoading } = useQuery({ queryKey: ['events', page, limit], queryFn: () => api.getEvents({ skip: (page - 1) * limit, limit }), }); return (

事件浏览

查看所有采集的事件数据

{/* Filters */}
setSearch(e.target.value)} className="w-full pl-10 pr-4 py-2 bg-[var(--card)] border border-[var(--border)] rounded-lg text-sm placeholder-zinc-500 focus:outline-none focus:ring-2 focus:ring-primary-500/50" />
{/* Events Table */}
{isLoading ? ( [...Array(10)].map((_, i) => ( )) ) : ( (events ?? []).map((event) => ( )) )}
事件ID 类型 语言 IDE 时间
{event.eventId.substring(0, 8)}... {event.eventType.replace(/_/g, ' ')} {event.language ?? '-'} {event.ideType} {new Date(event.timestamp).toLocaleString()}
{/* Pagination */}

显示 {(page - 1) * limit + 1} - {page * limit} 条

第 {page} 页
); }