diff --git a/src/app/(main)/websites/[websiteId]/WebsiteHeader.tsx b/src/app/(main)/websites/[websiteId]/WebsiteHeader.tsx index 1739cb4c1..642e9fe22 100644 --- a/src/app/(main)/websites/[websiteId]/WebsiteHeader.tsx +++ b/src/app/(main)/websites/[websiteId]/WebsiteHeader.tsx @@ -31,7 +31,7 @@ export function WebsiteHeader({ titleHref={allowLink ? renderUrl(`/websites/${website.id}`, false) : undefined} > - + {showActions && ( diff --git a/src/app/(main)/websites/[websiteId]/realtime/RealtimeLog.tsx b/src/app/(main)/websites/[websiteId]/realtime/RealtimeLog.tsx index 1bfa79ccd..17daaeed9 100644 --- a/src/app/(main)/websites/[websiteId]/realtime/RealtimeLog.tsx +++ b/src/app/(main)/websites/[websiteId]/realtime/RealtimeLog.tsx @@ -1,7 +1,7 @@ import { Column, Heading, Row, SearchField, Text } from '@umami/react-zen'; import Link from '@/components/common/Link'; import { useMemo, useState } from 'react'; -import { FixedSizeList } from 'react-window'; +import { List, type RowComponentProps } from 'react-window'; import { SessionModal } from '@/app/(main)/websites/[websiteId]/sessions/SessionModal'; import { useFormat } from '@/components//hooks/useFormat'; import { Avatar } from '@/components/common/Avatar'; @@ -121,7 +121,7 @@ export function RealtimeLog({ data }: { data: any }) { } }; - const TableRow = ({ index, style }) => { + const TableRow = ({ index, style, logs }: RowComponentProps<{ logs: any[] }>) => { const row = logs[index]; return ( @@ -195,9 +195,14 @@ export function RealtimeLog({ data }: { data: any }) { {logs?.length === 0 && } {logs?.length > 0 && ( - - {TableRow} - + )} diff --git a/src/components/hooks/queries/useActiveUsersQuery.ts b/src/components/hooks/queries/useActiveUsersQuery.ts index 42867c19d..7190a2f9c 100644 --- a/src/components/hooks/queries/useActiveUsersQuery.ts +++ b/src/components/hooks/queries/useActiveUsersQuery.ts @@ -1,7 +1,7 @@ import type { ReactQueryOptions } from '@/lib/types'; import { useApi } from '../useApi'; -export function useActyiveUsersQuery(websiteId: string, options?: ReactQueryOptions) { +export function useActiveUsersQuery(websiteId: string, options?: ReactQueryOptions) { const { get, useQuery } = useApi(); return useQuery({ queryKey: ['websites:active', websiteId], diff --git a/src/components/metrics/ActiveUsers.tsx b/src/components/metrics/ActiveUsers.tsx index f1aa989c6..9d58e82cc 100644 --- a/src/components/metrics/ActiveUsers.tsx +++ b/src/components/metrics/ActiveUsers.tsx @@ -7,17 +7,19 @@ export function ActiveUsers({ websiteId, value, refetchInterval = 60000, + allowLink = true, }: { websiteId: string; value?: number; refetchInterval?: number; + allowLink?: boolean; }) { const { t, labels } = useMessages(); const { data } = useActiveUsersQuery(websiteId, { refetchInterval }); const count = useMemo(() => { if (websiteId) { - return data?.visitors || 0; + return data?.visitors || 10; } return value !== undefined ? value : 0; @@ -27,13 +29,17 @@ export function ActiveUsers({ return null; } - return ( - - - - {count} {t(labels.online)} - - - + const content = ( + + + {count} {t(labels.online)} + + ); + + if (!allowLink) { + return content; + } + + return {content}; } \ No newline at end of file