mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
only use hourly table, remove daily table logic, fix updatechart undefined
This commit is contained in:
parent
038ecdb592
commit
174b9e4376
10 changed files with 38 additions and 166 deletions
|
|
@ -64,7 +64,7 @@ export default async (
|
|||
await useAuth(req, res);
|
||||
await useValidate(schema, req, res);
|
||||
|
||||
const { websiteId, type, limit, offset, search, unit } = req.query;
|
||||
const { websiteId, type, limit, offset, search } = req.query;
|
||||
|
||||
if (req.method === 'GET') {
|
||||
if (!(await canViewWebsite(req.auth, websiteId))) {
|
||||
|
|
@ -89,7 +89,7 @@ export default async (
|
|||
}
|
||||
|
||||
if (SESSION_COLUMNS.includes(type)) {
|
||||
const data = await getSessionMetrics(websiteId, type, filters, limit, offset, unit as string);
|
||||
const data = await getSessionMetrics(websiteId, type, filters, limit, offset);
|
||||
|
||||
if (type === 'language') {
|
||||
const combined = {};
|
||||
|
|
@ -111,14 +111,7 @@ export default async (
|
|||
}
|
||||
|
||||
if (EVENT_COLUMNS.includes(type)) {
|
||||
const data = await getPageviewMetrics(
|
||||
websiteId,
|
||||
type,
|
||||
filters,
|
||||
limit,
|
||||
offset,
|
||||
unit as string,
|
||||
);
|
||||
const data = await getPageviewMetrics(websiteId, type, filters, limit, offset);
|
||||
|
||||
return ok(res, data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ export default async (
|
|||
await useAuth(req, res);
|
||||
await useValidate(schema, req, res);
|
||||
|
||||
const { websiteId, compare, unit } = req.query;
|
||||
const { websiteId, compare } = req.query;
|
||||
|
||||
if (req.method === 'GET') {
|
||||
if (!(await canViewWebsite(req.auth, websiteId))) {
|
||||
|
|
@ -72,13 +72,13 @@ export default async (
|
|||
|
||||
const filters = getRequestFilters(req);
|
||||
|
||||
const metrics = await getWebsiteStats(websiteId, unit as string, {
|
||||
const metrics = await getWebsiteStats(websiteId, {
|
||||
...filters,
|
||||
startDate,
|
||||
endDate,
|
||||
});
|
||||
|
||||
const prevPeriod = await getWebsiteStats(websiteId, unit as string, {
|
||||
const prevPeriod = await getWebsiteStats(websiteId, {
|
||||
...filters,
|
||||
startDate: compareStartDate,
|
||||
endDate: compareEndDate,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue