mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Update realtime chart.
This commit is contained in:
parent
e64a555652
commit
fdc92d087b
32 changed files with 240 additions and 58 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import moment from 'moment-timezone';
|
||||
import { getEvents } from 'lib/queries';
|
||||
import { getEventMetrics } from 'lib/queries';
|
||||
import { ok, badRequest, methodNotAllowed, unauthorized } from 'lib/response';
|
||||
import { allowQuery } from 'lib/auth';
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ export default async (req, res) => {
|
|||
const startDate = new Date(+start_at);
|
||||
const endDate = new Date(+end_at);
|
||||
|
||||
const events = await getEvents(websiteId, startDate, endDate, tz, unit, { url });
|
||||
const events = await getEventMetrics(websiteId, startDate, endDate, tz, unit, { url });
|
||||
|
||||
return ok(res, events);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ export default async (req, res) => {
|
|||
return badRequest(res);
|
||||
}
|
||||
|
||||
const [pageviews, uniques] = await Promise.all([
|
||||
const [pageviews, sessions] = await Promise.all([
|
||||
getPageviewStats(websiteId, startDate, endDate, tz, unit, '*', url),
|
||||
getPageviewStats(websiteId, startDate, endDate, tz, unit, 'distinct session_id', url),
|
||||
]);
|
||||
|
||||
return ok(res, { pageviews, uniques });
|
||||
return ok(res, { pageviews, sessions });
|
||||
}
|
||||
|
||||
return methodNotAllowed(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue