mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Fixed realtime chart display.
This commit is contained in:
parent
93b77672f3
commit
802c262cd9
14 changed files with 112 additions and 75 deletions
|
|
@ -14,6 +14,7 @@ import '@fontsource/inter/600.css';
|
|||
const client = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
retry: false,
|
||||
refetchOnWindowFocus: false,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,9 +9,14 @@ export default async (req: NextApiRequestAuth, res: NextApiResponse<RealtimeInit
|
|||
await useAuth(req, res);
|
||||
|
||||
if (req.method === 'GET') {
|
||||
const { id } = req.query;
|
||||
const { id, startAt } = req.query;
|
||||
let startTime = subMinutes(new Date(), 30);
|
||||
|
||||
const data = await getRealtimeData(id, subMinutes(new Date(), 30));
|
||||
if (+startAt > startTime.getTime()) {
|
||||
startTime = new Date(+startAt);
|
||||
}
|
||||
|
||||
const data = await getRealtimeData(id, startTime);
|
||||
|
||||
return ok(res, data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export default function RealtimeDetailsPage() {
|
|||
|
||||
return (
|
||||
<AppLayout>
|
||||
<RealtimeDashboard websiteId={websiteId} />
|
||||
<RealtimeDashboard key={websiteId} websiteId={websiteId} />
|
||||
</AppLayout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue