mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Implements push-based real-time updates for the Sessions page. New sessions now appear instantly without manual reload or polling. Changes: - Add SSE event emitter for session creation notifications - Create SSE stream endpoint at /api/websites/[id]/sessions/stream - Emit session events in tracking endpoint when sessions are created - Add useSessionStream hook to connect to SSE and invalidate queries - Fix LoadingPanel to prevent flicker during background refetches
16 lines
540 B
TypeScript
16 lines
540 B
TypeScript
import { DataGrid } from '@/components/common/DataGrid';
|
|
import { useSessionStream, useWebsiteSessionsQuery } from '@/components/hooks';
|
|
import { SessionsTable } from './SessionsTable';
|
|
|
|
export function SessionsDataTable({ websiteId }: { websiteId?: string; teamId?: string }) {
|
|
useSessionStream(websiteId);
|
|
const queryResult = useWebsiteSessionsQuery(websiteId);
|
|
|
|
return (
|
|
<DataGrid query={queryResult} allowPaging allowSearch>
|
|
{({ data }) => {
|
|
return <SessionsTable data={data} />;
|
|
}}
|
|
</DataGrid>
|
|
);
|
|
}
|