mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 10:35:35 +01:00
Sessions page.
This commit is contained in:
parent
cd0f185f77
commit
ac60d08ee5
17 changed files with 414 additions and 16 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import Link from 'next/link';
|
||||
import { GridColumn, GridTable, useBreakpoint } from 'react-basics';
|
||||
import { useFormat, useMessages } from 'components/hooks';
|
||||
import { formatDistanceToNow } from 'date-fns';
|
||||
import Profile from 'components/common/Profile';
|
||||
|
||||
export function SessionsTable({ data = [] }: { data: any[]; showDomain?: boolean }) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
|
@ -9,7 +11,16 @@ export function SessionsTable({ data = [] }: { data: any[]; showDomain?: boolean
|
|||
|
||||
return (
|
||||
<GridTable data={data} cardMode={['xs', 'sm', 'md'].includes(breakpoint)}>
|
||||
<GridColumn name="id" label="ID" />
|
||||
<GridColumn name="pic" label="" width="90px">
|
||||
{row => <Profile seed={row.id} size={64} />}
|
||||
</GridColumn>
|
||||
<GridColumn name="id" label="ID">
|
||||
{row => (
|
||||
<Link href={`sessions/${row.id}`}>
|
||||
{row.id} ({row.firstAt !== row.lastAt ? 'YES' : 'NO'})
|
||||
</Link>
|
||||
)}
|
||||
</GridColumn>
|
||||
<GridColumn name="country" label={formatMessage(labels.country)}>
|
||||
{row => formatValue(row.country, 'country')}
|
||||
</GridColumn>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue