Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Device icons

Blue Mouse1e32cb7b7ee9
diff --git a/web/app/pages/Captcha/View/ViewCaptcha.tsx b/web/app/pages/Captcha/View/ViewCaptcha.tsx
index c37398da9..9a3cb038b 100644
--- a/web/app/pages/Captcha/View/ViewCaptcha.tsx
+++ b/web/app/pages/Captcha/View/ViewCaptcha.tsx
@@ -59,7 +59,7 @@ import {
getColumns,
PANELS_ORDER,
} from './ViewCaptcha.helpers'
-import { onCSVExportClick } from '~/pages/Project/View/ViewProject.helpers'
+import { deviceIconMapping, onCSVExportClick } from '~/pages/Project/View/ViewProject.helpers'
import CCRow from '../../Project/View/components/CCRow'
import NoEvents from './components/NoEvents'
import { useRequiredParams } from '~/hooks/useRequiredParams'
@@ -808,6 +808,23 @@ const ViewCaptcha = ({ ssrTheme }: ViewCaptchaProps) => {
onFilter={filterHandler}
name={panelName}
data={panelsData.data[type]}
+ rowMapper={(entry: { name: keyof typeof deviceIconMapping }) => {
+ const { name: entryName } = entry
+
+ const icon = deviceIconMapping[entryName]
+
+ if (!icon) {
+ return entryName
+ }
+
+ return (
+ <>
+ {icon}
+ &nbsp;
+ {entryName}
+ </>
+ )
+ }}
capitalize
/>
)
diff --git a/web/app/pages/Project/View/ViewProject.helpers.tsx b/web/app/pages/Project/View/ViewProject.helpers.tsx
index b6162bde1..7e99f9404 100644
--- a/web/app/pages/Project/View/ViewProject.helpers.tsx
+++ b/web/app/pages/Project/View/ViewProject.helpers.tsx
@@ -38,7 +38,20 @@ import { Entry } from '~/lib/models/Entry'
import { getTimeFromSeconds, getStringFromTime, sumArrays, nFormatter } from '~/utils/generic'
import countries from '~/utils/isoCountries'
import { AnalyticsFunnel } from '~/lib/models/Project'
-import { CompassIcon, FileTextIcon, MapPinIcon, MonitorCog, TabletSmartphoneIcon } from 'lucide-react'
+import {
+ CompassIcon,
+ CpuIcon,
+ FileTextIcon,
+ Gamepad2Icon,
+ MapPinIcon,
+ MonitorCog,
+ MonitorIcon,
+ SmartphoneIcon,
+ TabletIcon,
+ TabletSmartphoneIcon,
+ TvIcon,
+ WatchIcon,
+} from 'lucide-react'
const getAvg = (arr: any) => {
const total = _reduce(arr, (acc, c) => acc + c, 0)
@@ -1593,6 +1606,16 @@ const panelIconMapping = {
os: <MonitorCog className={iconClassName} strokeWidth={1.5} />,
}
+export const deviceIconMapping = {
+ desktop: <MonitorIcon className='size-5' strokeWidth={1.5} />,
+ mobile: <SmartphoneIcon className='size-5' strokeWidth={1.5} />,
+ tablet: <TabletIcon className='size-5' strokeWidth={1.5} />,
+ smarttv: <TvIcon className='size-5' strokeWidth={1.5} />,
+ console: <Gamepad2Icon className='size-5' strokeWidth={1.5} />,
+ wearable: <WatchIcon className='size-5' strokeWidth={1.5} />,
+ embedded: <CpuIcon className='size-5' strokeWidth={1.5} />,
+}
+
// This function return date using the same format as the backend
const getFormatDate = (date: Date) => {
const yyyy = date.getFullYear()
diff --git a/web/app/pages/Project/View/ViewProject.tsx b/web/app/pages/Project/View/ViewProject.tsx
index 50cc1e7c2..b4c322f09 100644
--- a/web/app/pages/Project/View/ViewProject.tsx
+++ b/web/app/pages/Project/View/ViewProject.tsx
@@ -160,6 +160,7 @@ import {
SHORTCUTS_GENERAL_LISTENERS,
SHORTCUTS_TIMEBUCKETS_LISTENERS,
CHART_MEASURES_MAPPING_PERF,
+ deviceIconMapping,
} from './ViewProject.helpers'
import CCRow from './components/CCRow'
import FunnelsList from './components/FunnelsList'
@@ -4133,6 +4134,23 @@ const ViewProject = () => {
onFilter={filterHandler}
name={panelName}
data={activeError.params[type]}
+ rowMapper={(entry: { name: keyof typeof deviceIconMapping }) => {
+ const { name: entryName } = entry
+
+ const icon = deviceIconMapping[entryName]
+
+ if (!icon) {
+ return entryName
+ }
+
+ return (
+ <>
+ {icon}
+ &nbsp;
+ {entryName}
+ </>
+ )
+ }}
capitalize
/>
)
@@ -4416,6 +4434,23 @@ const ViewProject = () => {
name={panelName}
data={dataSource[type]}
customTabs={customTabs}
+ rowMapper={(entry: { name: keyof typeof deviceIconMapping }) => {
+ const { name: entryName } = entry
+
+ const icon = deviceIconMapping[entryName]
+
+ if (!icon) {
+ return entryName
+ }
+
+ return (
+ <>
+ {icon}
+ &nbsp;
+ {entryName}
+ </>
+ )
+ }}
capitalize
/>
)
@@ -4606,6 +4641,23 @@ const ViewProject = () => {
name={panelName}
data={panelsDataPerf.data[type]}
customTabs={customTabs}
+ rowMapper={(entry: { name: keyof typeof deviceIconMapping }) => {
+ const { name: entryName } = entry
+
+ const icon = deviceIconMapping[entryName]
+
+ if (!icon) {
+ return entryName
+ }
+
+ return (
+ <>
+ {icon}
+ &nbsp;
+ {entryName}
+ </>
+ )
+ }}
// @ts-expect-error
valueMapper={(value) => getStringFromTime(getTimeFromSeconds(value), true)}
capitalize