Merge branch 'dev' into jajaja

# Conflicts:
#	pnpm-lock.yaml
#	postcss.config.js
#	src/app/(main)/websites/[websiteId]/sessions/SessionsDataTable.tsx
#	src/app/(main)/websites/[websiteId]/sessions/[sessionId]/SessionInfo.tsx
This commit is contained in:
Mike Cao 2025-05-01 03:31:51 -07:00
commit c0ccffeab4
21 changed files with 382 additions and 1281 deletions

View file

@ -14,7 +14,7 @@ export function SessionsDataTable({
const queryResult = useWebsiteSessionsQuery(websiteId);
return (
<DataGrid queryResult={queryResult} allowSearch={false} renderEmpty={() => children}>
<DataGrid queryResult={queryResult} allowSearch={true} renderEmpty={() => children}>
{({ data }) => <SessionsTable data={data} showDomain={!websiteId} />}
</DataGrid>
);

View file

@ -17,6 +17,11 @@ export function SessionInfo({ data }) {
<TextField value={data?.id} allowCopy />
</Box>
<Box>
<Label>{formatMessage(labels.distinctId)}</Label>
<Row>{data?.distinctId}</Row>
</Box>
<Box>
<Label>{formatMessage(labels.lastSeen)}</Label>
<Row>{formatTimezoneDate(data?.lastAt, 'PPPPpp')}</Row>

View file

@ -121,6 +121,7 @@ export async function POST(request: Request) {
country,
region,
city,
distinctId: id,
});
} catch (e: any) {
if (!e.message.toLowerCase().includes('unique constraint')) {
@ -144,7 +145,7 @@ export async function POST(request: Request) {
const base = hostname ? `https://${hostname}` : 'https://localhost';
const currentUrl = new URL(url, base);
let urlPath = currentUrl.pathname;
let urlPath = currentUrl.pathname === '/undefined' ? '' : currentUrl.pathname;
const urlQuery = currentUrl.search.substring(1);
const urlDomain = currentUrl.hostname.replace(/^www./, '');
@ -215,6 +216,7 @@ export async function POST(request: Request) {
region,
city,
tag,
distinctId: id,
createdAt,
});
}
@ -228,6 +230,7 @@ export async function POST(request: Request) {
websiteId,
sessionId,
sessionData: data,
distinctId: id,
createdAt,
});
}