Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
New overview layout.
Mike Cao5f27ba149b86
diff --git a/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsx b/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsxindex ed0fb8061..28a0c0017 100644--- a/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsx+++ b/src/app/(main)/websites/[websiteId]/WebsiteExpandedView.tsx@@ -52,12 +52,12 @@ export function WebsiteExpandedView({items: [{id: 'referrer',- label: formatMessage(labels.referrers),+ label: formatMessage(labels.referrer),path: updateParams({ view: 'referrer' }),},{id: 'channel',- label: formatMessage(labels.channels),+ label: formatMessage(labels.channel),path: updateParams({ view: 'channel' }),},{@@ -72,17 +72,17 @@ export function WebsiteExpandedView({items: [{id: 'country',- label: formatMessage(labels.countries),+ label: formatMessage(labels.country),path: updateParams({ view: 'country' }),},{id: 'region',- label: formatMessage(labels.regions),+ label: formatMessage(labels.region),path: updateParams({ view: 'region' }),},{id: 'city',- label: formatMessage(labels.cities),+ label: formatMessage(labels.city),path: updateParams({ view: 'city' }),},],@@ -92,7 +92,7 @@ export function WebsiteExpandedView({items: [{id: 'browser',- label: formatMessage(labels.browsers),+ label: formatMessage(labels.browser),path: updateParams({ view: 'browser' }),},{@@ -102,17 +102,17 @@ export function WebsiteExpandedView({},{id: 'device',- label: formatMessage(labels.devices),+ label: formatMessage(labels.device),path: updateParams({ view: 'device' }),},{id: 'language',- label: formatMessage(labels.languages),+ label: formatMessage(labels.language),path: updateParams({ view: 'language' }),},{id: 'screen',- label: formatMessage(labels.screens),+ label: formatMessage(labels.screen),path: updateParams({ view: 'screen' }),},],@@ -122,7 +122,7 @@ export function WebsiteExpandedView({items: [{id: 'event',- label: formatMessage(labels.events),+ label: formatMessage(labels.event),path: updateParams({ view: 'event' }),},{@@ -132,7 +132,7 @@ export function WebsiteExpandedView({},{id: 'tag',- label: formatMessage(labels.tags),+ label: formatMessage(labels.tag),path: updateParams({ view: 'tag' }),},],diff --git a/src/app/(main)/websites/[websiteId]/WebsitePanels.tsx b/src/app/(main)/websites/[websiteId]/WebsitePanels.tsxindex c0638b7f6..97f8f9531 100644--- a/src/app/(main)/websites/[websiteId]/WebsitePanels.tsx+++ b/src/app/(main)/websites/[websiteId]/WebsitePanels.tsx@@ -59,10 +59,28 @@ export function WebsitePanels({ websiteId }: { websiteId: string }) {</Tabs></Panel></GridRow>- <GridRow layout="two-one" {...rowProps}>- <Panel gridColumn="span 2" noPadding>- <WorldMap websiteId={websiteId} />++ <GridRow layout="two" {...rowProps}>+ <Panel>+ <Heading size="2">{formatMessage(labels.environment)}</Heading>+ <Tabs>+ <TabList>+ <Tab id="browser">{formatMessage(labels.browsers)}</Tab>+ <Tab id="os">{formatMessage(labels.os)}</Tab>+ <Tab id="device">{formatMessage(labels.devices)}</Tab>+ </TabList>+ <TabPanel id="browser">+ <MetricsTable type="browser" title={formatMessage(labels.browser)} {...tableProps} />+ </TabPanel>+ <TabPanel id="os">+ <MetricsTable type="os" title={formatMessage(labels.os)} {...tableProps} />+ </TabPanel>+ <TabPanel id="device">+ <MetricsTable type="device" title={formatMessage(labels.device)} {...tableProps} />+ </TabPanel>+ </Tabs></Panel>+<Panel><Heading size="2">{formatMessage(labels.location)}</Heading><Tabs>@@ -83,26 +101,12 @@ export function WebsitePanels({ websiteId }: { websiteId: string }) {</Tabs></Panel></GridRow>- <GridRow layout="two" {...rowProps}>- <Panel>- <Heading size="2">{formatMessage(labels.environment)}</Heading>- <Tabs>- <TabList>- <Tab id="browser">{formatMessage(labels.browsers)}</Tab>- <Tab id="os">{formatMessage(labels.os)}</Tab>- <Tab id="device">{formatMessage(labels.devices)}</Tab>- </TabList>- <TabPanel id="browser">- <MetricsTable type="browser" title={formatMessage(labels.browser)} {...tableProps} />- </TabPanel>- <TabPanel id="os">- <MetricsTable type="os" title={formatMessage(labels.os)} {...tableProps} />- </TabPanel>- <TabPanel id="device">- <MetricsTable type="device" title={formatMessage(labels.device)} {...tableProps} />- </TabPanel>- </Tabs>++ <GridRow layout="two-one" {...rowProps}>+ <Panel gridColumn="span 2" noPadding>+ <WorldMap websiteId={websiteId} /></Panel>+<Panel><Heading size="2">{formatMessage(labels.traffic)}</Heading><Row border="bottom" marginBottom="4" />diff --git a/src/components/common/LoadingPanel.tsx b/src/components/common/LoadingPanel.tsxindex 786dd275a..9caffee8e 100644--- a/src/components/common/LoadingPanel.tsx+++ b/src/components/common/LoadingPanel.tsx@@ -10,6 +10,7 @@ export interface LoadingPanelProps extends ColumnProps {isLoading?: boolean;isFetching?: boolean;loadingIcon?: 'dots' | 'spinner';+ loadingPosition?: 'center' | 'page' | 'inline';renderEmpty?: () => ReactNode;children: ReactNode;}@@ -21,6 +22,7 @@ export function LoadingPanel({isLoading,isFetching,loadingIcon = 'dots',+ loadingPosition = 'page',renderEmpty = () => <Empty />,children,...props@@ -32,7 +34,7 @@ export function LoadingPanel({{/* Show loading spinner only if no data exists */}{(isLoading || isFetching) && (<Column position="relative" height="100%" {...props}>- <Loading icon={loadingIcon} position="page" />+ <Loading icon={loadingIcon} position={loadingPosition} /></Column>)}diff --git a/src/components/metrics/MetricsExpandedTable.tsx b/src/components/metrics/MetricsExpandedTable.tsxindex 35da0ee6c..164a92ef7 100644--- a/src/components/metrics/MetricsExpandedTable.tsx+++ b/src/components/metrics/MetricsExpandedTable.tsx@@ -67,6 +67,7 @@ export function MetricsExpandedTable({isLoading={isLoading}error={error}height="100%"+ loadingIcon="spinner"><Column overflowY="auto" minHeight="0" height="100%" paddingRight="3" overflow="hidden">{items && (diff --git a/src/components/metrics/WorldMap.tsx b/src/components/metrics/WorldMap.tsxindex 76ec1abcc..5cc2d764d 100644--- a/src/components/metrics/WorldMap.tsx+++ b/src/components/metrics/WorldMap.tsx@@ -5,7 +5,6 @@ import classNames from 'classnames';import { colord } from 'colord';import { ISO_COUNTRIES, MAP_FILE } from '@/lib/constants';import {- useDateRange,useWebsiteMetricsQuery,useCountryNames,useLocale,@@ -30,14 +29,11 @@ export function WorldMap({ websiteId, data, className, ...props }: WorldMapPropsconst { countryNames } = useCountryNames(locale);const visitorsLabel = formatMessage(labels.visitors).toLocaleLowerCase(locale);const unknownLabel = formatMessage(labels.unknown);- const {- dateRange: { startDate, endDate },- } = useDateRange(websiteId);+const { data: mapData } = useWebsiteMetricsQuery(websiteId, {type: 'country',- startAt: +startDate,- endAt: +endDate,});+const metrics = useMemo(() => (data || mapData ? percentFilter((data || mapData) as any[]) : []),[data, mapData],