mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 06:37:18 +01:00
Update realtime chart.
This commit is contained in:
parent
e64a555652
commit
fdc92d087b
32 changed files with 240 additions and 58 deletions
|
|
@ -166,16 +166,6 @@ export async function createSession(website_id, data) {
|
|||
);
|
||||
}
|
||||
|
||||
export async function getSessionById(session_id) {
|
||||
return runQuery(
|
||||
prisma.session.findOne({
|
||||
where: {
|
||||
session_id,
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export async function getSessionByUuid(session_uuid) {
|
||||
return runQuery(
|
||||
prisma.session.findOne({
|
||||
|
|
@ -285,6 +275,57 @@ export async function createAccount(data) {
|
|||
);
|
||||
}
|
||||
|
||||
export async function getSessions(websites, start_at) {
|
||||
return runQuery(
|
||||
prisma.session.findMany({
|
||||
where: {
|
||||
website: {
|
||||
website_id: {
|
||||
in: websites,
|
||||
},
|
||||
},
|
||||
created_at: {
|
||||
gte: start_at,
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export async function getPageviews(websites, start_at) {
|
||||
return runQuery(
|
||||
prisma.pageview.findMany({
|
||||
where: {
|
||||
website: {
|
||||
website_id: {
|
||||
in: websites,
|
||||
},
|
||||
},
|
||||
created_at: {
|
||||
gte: start_at,
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export async function getEvents(websites, start_at) {
|
||||
return runQuery(
|
||||
prisma.event.findMany({
|
||||
where: {
|
||||
website: {
|
||||
website_id: {
|
||||
in: websites,
|
||||
},
|
||||
},
|
||||
created_at: {
|
||||
gte: start_at,
|
||||
},
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function getWebsiteStats(website_id, start_at, end_at, filters = {}) {
|
||||
const params = [website_id, start_at, end_at];
|
||||
const { url } = filters;
|
||||
|
|
@ -425,7 +466,7 @@ export function getActiveVisitors(website_id) {
|
|||
);
|
||||
}
|
||||
|
||||
export function getEvents(
|
||||
export function getEventMetrics(
|
||||
website_id,
|
||||
start_at,
|
||||
end_at,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue