mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
Updated query filters. Updated packages.
This commit is contained in:
parent
6bb34cd3a5
commit
11d8b19279
7 changed files with 35 additions and 17 deletions
|
|
@ -285,8 +285,9 @@ export async function createAccount(data) {
|
|||
);
|
||||
}
|
||||
|
||||
export function getMetrics(website_id, start_at, end_at, url) {
|
||||
export function getMetrics(website_id, start_at, end_at, filters = {}) {
|
||||
const params = [website_id, start_at, end_at];
|
||||
const { url } = filters;
|
||||
let urlFilter = '';
|
||||
|
||||
if (url) {
|
||||
|
|
@ -348,8 +349,10 @@ export function getPageviews(
|
|||
);
|
||||
}
|
||||
|
||||
export function getSessionMetrics(website_id, start_at, end_at, field, url) {
|
||||
export function getSessionMetrics(website_id, start_at, end_at, field, filters = {}) {
|
||||
const params = [website_id, start_at, end_at];
|
||||
const { url } = filters;
|
||||
|
||||
let urlFilter = '';
|
||||
|
||||
if (url) {
|
||||
|
|
@ -375,13 +378,15 @@ export function getSessionMetrics(website_id, start_at, end_at, field, url) {
|
|||
);
|
||||
}
|
||||
|
||||
export function getPageviewMetrics(website_id, start_at, end_at, field, table, domain, url) {
|
||||
export function getPageviewMetrics(website_id, start_at, end_at, field, table, filters = {}) {
|
||||
const params = [website_id, start_at, end_at];
|
||||
const { domain, url } = filters;
|
||||
|
||||
let domainFilter = '';
|
||||
let urlFilter = '';
|
||||
|
||||
if (domain) {
|
||||
domainFilter = `and referrer not like $${params.length + 1}`;
|
||||
domainFilter = `and referrer not like $${params.length + 1} and referrer not like '/%'`;
|
||||
params.push(`%${domain}%`);
|
||||
}
|
||||
|
||||
|
|
@ -420,8 +425,17 @@ export function getActiveVisitors(website_id) {
|
|||
);
|
||||
}
|
||||
|
||||
export function getEvents(website_id, start_at, end_at, timezone = 'utc', unit = 'day', url) {
|
||||
export function getEvents(
|
||||
website_id,
|
||||
start_at,
|
||||
end_at,
|
||||
timezone = 'utc',
|
||||
unit = 'day',
|
||||
filters = {},
|
||||
) {
|
||||
const params = [website_id, start_at, end_at];
|
||||
const { url } = filters;
|
||||
|
||||
let urlFilter = '';
|
||||
|
||||
if (url) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue