mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Fixed queries.
This commit is contained in:
parent
e98bc3bd74
commit
8d92509f71
@ -12,7 +12,11 @@
|
||||
|
||||
.time {
|
||||
color: var(--font-color200);
|
||||
width: 120px;
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.value {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.header {
|
||||
|
@ -42,7 +42,7 @@ export function SessionActivity({
|
||||
</StatusLight>
|
||||
</div>
|
||||
<Icon>{eventName ? <Icons.Bolt /> : <Icons.Eye />}</Icon>
|
||||
<div>{eventName || urlPath}</div>
|
||||
<div className={styles.value}>{eventName || urlPath}</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
@ -17,12 +17,11 @@ async function relationalQuery(websiteId: string, filters: QueryFilters, pagePar
|
||||
const { query } = pageParams;
|
||||
|
||||
const where = {
|
||||
...filters,
|
||||
id: websiteId,
|
||||
...prisma.getSearchParameters(query, [{ eventName: 'contains' }, { urlPath: 'contains' }]),
|
||||
};
|
||||
|
||||
return pagedQuery('website_event', { where }, pageParams);
|
||||
return pagedQuery('WebsiteEvent', { where }, pageParams);
|
||||
}
|
||||
|
||||
async function clickhouseQuery(websiteId: string, filters: QueryFilters, pageParams?: PageParams) {
|
||||
|
@ -22,9 +22,13 @@ async function relationalQuery(
|
||||
{ pageviews: number; visitors: number; visits: number; bounces: number; totaltime: number }[]
|
||||
> {
|
||||
const { getTimestampDiffSQL, parseFilters, rawQuery } = prisma;
|
||||
const { filterQuery, joinSession, params } = await parseFilters(websiteId, {
|
||||
const { filterQuery, joinSession, params } = await parseFilters(
|
||||
websiteId,
|
||||
{
|
||||
...filters,
|
||||
});
|
||||
},
|
||||
{ joinSession: true },
|
||||
);
|
||||
|
||||
return rawQuery(
|
||||
`
|
||||
@ -34,7 +38,7 @@ async function relationalQuery(
|
||||
count(distinct t.visit_id) as "visits",
|
||||
count(distinct t.country) as "countries",
|
||||
sum(case when t.c = 1 then 1 else 0 end) as "bounces",
|
||||
sum(${getTimestampDiffSQL('t.min_time', 't.max_time')}) as "totaltime",
|
||||
sum(${getTimestampDiffSQL('t.min_time', 't.max_time')}) as "totaltime"
|
||||
from (
|
||||
select
|
||||
website_event.session_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user