mirror of
https://github.com/umami-software/umami.git
synced 2026-02-24 14:35:35 +01:00
Fixed attribution report. New metric cards. Converted ListTable.
This commit is contained in:
parent
b2aa37a3df
commit
4995a0e1e4
19 changed files with 167 additions and 288 deletions
|
|
@ -1,55 +0,0 @@
|
|||
'use client';
|
||||
import { firstBy } from 'thenby';
|
||||
import { Grid } from '@umami/react-zen';
|
||||
import { GridRow } from '@/components/common/GridRow';
|
||||
import { PageBody } from '@/components/common/PageBody';
|
||||
import { Panel } from '@/components/common/Panel';
|
||||
import { RealtimeChart } from '@/components/metrics/RealtimeChart';
|
||||
import { WorldMap } from '@/components/metrics/WorldMap';
|
||||
import { useRealtimeQuery } from '@/components/hooks';
|
||||
import { RealtimeLog } from './RealtimeLog';
|
||||
import { RealtimeHeader } from './RealtimeHeader';
|
||||
import { RealtimeUrls } from './RealtimeUrls';
|
||||
import { RealtimeCountries } from './RealtimeCountries';
|
||||
import { percentFilter } from '@/lib/filters';
|
||||
|
||||
export function WebsiteRealtimePage({ websiteId }: { websiteId: string }) {
|
||||
const { data, isLoading, error } = useRealtimeQuery(websiteId);
|
||||
|
||||
if (isLoading || error) {
|
||||
return <PageBody isLoading={isLoading} error={error} />;
|
||||
}
|
||||
|
||||
const countries = percentFilter(
|
||||
Object.keys(data.countries)
|
||||
.map(key => ({ x: key, y: data.countries[key] }))
|
||||
.sort(firstBy('y', -1)),
|
||||
);
|
||||
|
||||
return (
|
||||
<Grid gap="3">
|
||||
<Panel>
|
||||
<RealtimeHeader data={data} />
|
||||
</Panel>
|
||||
<Panel>
|
||||
<RealtimeChart data={data} unit="minute" />
|
||||
</Panel>
|
||||
<GridRow layout="two">
|
||||
<Panel>
|
||||
<RealtimeUrls data={data} />
|
||||
</Panel>
|
||||
<Panel>
|
||||
<RealtimeLog data={data} />
|
||||
</Panel>
|
||||
</GridRow>
|
||||
<GridRow layout="one-two">
|
||||
<Panel>
|
||||
<RealtimeCountries data={countries} />
|
||||
</Panel>
|
||||
<Panel padding="0" gridColumn="span 2">
|
||||
<WorldMap data={countries} />
|
||||
</Panel>
|
||||
</GridRow>
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue