-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated session profile page. Added TypeIcon component. Added useRegi…
…onNames hook.
- Loading branch information
Showing
313 changed files
with
197 additions
and
94 deletions.
There are no files selected for viewing
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { Metadata } from 'next'; | ||
import WebsiteProvider from './WebsiteProvider'; | ||
|
||
export default function ({ children, params: { websiteId } }) { | ||
if (process.env.cloudMode) { | ||
return null; | ||
} | ||
|
||
return <WebsiteProvider websiteId={websiteId}>{children}</WebsiteProvider>; | ||
} | ||
|
||
export const metadata: Metadata = { | ||
title: { | ||
template: '%s | Umami', | ||
default: 'Websites | Umami', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/app/(main)/websites/[websiteId]/sessions/[sessionId]/SessionDetailsPage.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
.page { | ||
display: grid; | ||
grid-template-columns: 300px 1fr; | ||
} | ||
|
||
.sidebar { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
gap: 20px; | ||
padding-right: 20px; | ||
border-right: 1px solid var(--base300); | ||
} | ||
|
||
.content { | ||
padding-left: 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/app/(main)/websites/[websiteId]/sessions/[sessionId]/SessionInfo.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.info { | ||
display: grid; | ||
gap: 10px; | ||
} | ||
|
||
.info dt { | ||
color: var(--font-color200); | ||
font-weight: bold; | ||
} | ||
|
||
.info dd { | ||
display: flex; | ||
gap: 10px; | ||
align-items: center; | ||
margin: 5px 0 28px; | ||
text-align: left; | ||
} |
63 changes: 54 additions & 9 deletions
63
src/app/(main)/websites/[websiteId]/sessions/[sessionId]/SessionInfo.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,62 @@ | ||
import Profile from 'components/common/Profile'; | ||
import { format } from 'date-fns'; | ||
import { useFormat, useLocale, useMessages, useRegionNames } from 'components/hooks'; | ||
import TypeIcon from 'components/common/TypeIcon'; | ||
import { Icon, CopyIcon } from 'react-basics'; | ||
import Icons from 'components/icons'; | ||
import styles from './SessionInfo.module.css'; | ||
|
||
export default function SessionInfo({ data }) { | ||
const { locale } = useLocale(); | ||
const { formatMessage, labels } = useMessages(); | ||
const { formatValue } = useFormat(); | ||
const { getRegionName } = useRegionNames(locale); | ||
|
||
return ( | ||
<h1> | ||
<Profile seed={data?.id} /> | ||
<div className={styles.info}> | ||
<dl> | ||
<dt>ID</dt> | ||
<dd>{data?.id}</dd> | ||
<dt>Country</dt> | ||
<dd>{data?.country}</dd> | ||
<dt>City</dt> | ||
<dd>{data?.city}</dd> | ||
<dd> | ||
{data?.id} <CopyIcon value={data?.id} /> | ||
</dd> | ||
<dt>{formatMessage(labels.firstSeen)}</dt> | ||
<dd>{format(new Date(data?.firstAt), 'PPPpp')}</dd> | ||
<dt>{formatMessage(labels.lastSeen)}</dt> | ||
<dd>{format(new Date(data?.lastAt), 'PPPpp')}</dd> | ||
<dt>{formatMessage(labels.country)}</dt> | ||
<dd> | ||
<TypeIcon type="country" value={data?.country} /> | ||
{formatValue(data?.country, 'country')} | ||
</dd> | ||
<dt>{formatMessage(labels.region)}</dt> | ||
<dd> | ||
<Icon> | ||
<Icons.Location /> | ||
</Icon> | ||
{getRegionName(data?.subdivision1)} | ||
</dd> | ||
<dt>{formatMessage(labels.city)}</dt> | ||
<dd> | ||
<Icon> | ||
<Icons.Location /> | ||
</Icon> | ||
{data?.city} | ||
</dd> | ||
<dt>{formatMessage(labels.os)}</dt> | ||
<dd> | ||
<TypeIcon type="os" value={data?.os?.toLowerCase()?.replaceAll(/\W/g, '-')} /> | ||
{formatValue(data?.os, 'os')} | ||
</dd> | ||
<dt>{formatMessage(labels.device)}</dt> | ||
<dd> | ||
<TypeIcon type="device" value={data?.device} /> | ||
{formatValue(data?.device, 'device')} | ||
</dd> | ||
<dt>{formatMessage(labels.browser)}</dt> | ||
<dd> | ||
<TypeIcon type="browser" value={data?.browser} /> | ||
{formatValue(data?.browser, 'browser')} | ||
</dd> | ||
</dl> | ||
</h1> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export function TypeIcon({ | ||
type, | ||
value, | ||
}: { | ||
type: 'browser' | 'country' | 'device' | 'os'; | ||
value: string; | ||
}) { | ||
return ( | ||
<img | ||
src={`${process.env.basePath || ''}/images/${type}/${value || 'unknown'}.png`} | ||
alt={value} | ||
width={type === 'country' ? undefined : 16} | ||
height={type === 'country' ? undefined : 16} | ||
/> | ||
); | ||
} | ||
|
||
export default TypeIcon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.