mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 09:35:36 +01:00
Added report context. Removed report store.
This commit is contained in:
parent
bc37f5124e
commit
bfb52eb678
31 changed files with 372 additions and 273 deletions
26
pages/realtime/[id].js
Normal file
26
pages/realtime/[id].js
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import { useRouter } from 'next/router';
|
||||
import AppLayout from 'components/layout/AppLayout';
|
||||
import RealtimeDashboard from 'components/pages/realtime/RealtimeDashboard';
|
||||
import useMessages from 'hooks/useMessages';
|
||||
import useApi from 'hooks/useApi';
|
||||
|
||||
export default function RealtimeDetailsPage() {
|
||||
const router = useRouter();
|
||||
const { id: websiteId } = router.query;
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { get, useQuery } = useApi();
|
||||
const { data: website } = useQuery(['websites', websiteId], () => get(`/websites/${websiteId}`), {
|
||||
enabled: !!websiteId,
|
||||
});
|
||||
const title = `${formatMessage(labels.realtime)}${website?.name ? ` - ${website.name}` : ''}`;
|
||||
|
||||
if (!websiteId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<AppLayout title={title}>
|
||||
<RealtimeDashboard key={websiteId} websiteId={websiteId} />
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue