mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Responsive styles for session page.
This commit is contained in:
parent
b3e6e52473
commit
10f65cae68
7 changed files with 18 additions and 14 deletions
|
|
@ -35,6 +35,7 @@ async function clickhouseQuery(websiteId: string, sessionId: string) {
|
|||
from session_data
|
||||
where website_id = {websiteId:UUID}
|
||||
and session_id = {sessionId:UUID}
|
||||
order by data_key asc
|
||||
`,
|
||||
{ websiteId, sessionId },
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,23 +2,22 @@ import prisma from 'lib/prisma';
|
|||
import clickhouse from 'lib/clickhouse';
|
||||
import { runQuery, PRISMA, CLICKHOUSE } from 'lib/db';
|
||||
|
||||
export async function getWebsiteSession(...args: [websiteId: string, sessionId: string]) {
|
||||
export async function getWebsiteSession(...args: [sessionId: string]) {
|
||||
return runQuery({
|
||||
[PRISMA]: () => relationalQuery(...args),
|
||||
[CLICKHOUSE]: () => clickhouseQuery(...args),
|
||||
});
|
||||
}
|
||||
|
||||
async function relationalQuery(websiteId: string, sessionId: string) {
|
||||
async function relationalQuery(sessionId: string) {
|
||||
return prisma.client.session.findUnique({
|
||||
where: {
|
||||
id: sessionId,
|
||||
websiteId,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async function clickhouseQuery(websiteId: string, sessionId: string) {
|
||||
async function clickhouseQuery(sessionId: string) {
|
||||
const { rawQuery } = clickhouse;
|
||||
|
||||
return rawQuery(
|
||||
|
|
@ -41,10 +40,9 @@ async function clickhouseQuery(websiteId: string, sessionId: string) {
|
|||
sumIf(1, event_type = 1) as views,
|
||||
sumIf(1, event_type = 2) as events
|
||||
from website_event
|
||||
where website_id = {websiteId:UUID}
|
||||
and session_id = {sessionId:UUID}
|
||||
where session_id = {sessionId:UUID}
|
||||
group by session_id, website_id, hostname, browser, os, device, screen, language, country, subdivision1, city
|
||||
`,
|
||||
{ websiteId, sessionId },
|
||||
{ sessionId },
|
||||
).then(result => result?.[0]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue