Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

update serie icons

Carl-Gerhard Lindesvärd43f9cf08b557
diff --git a/apps/dashboard/src/components/report/chart/SerieIcon.tsx b/apps/dashboard/src/components/report/chart/SerieIcon.tsx
index c06edff25..04f8eee54 100644
--- a/apps/dashboard/src/components/report/chart/SerieIcon.tsx
+++ b/apps/dashboard/src/components/report/chart/SerieIcon.tsx
@@ -5,6 +5,7 @@ import {
ExternalLinkIcon,
HelpCircleIcon,
MailIcon,
+ MessageCircleIcon,
MonitorIcon,
MonitorPlayIcon,
PodcastIcon,
@@ -47,6 +48,8 @@ const mapper: Record<string, LucideIcon> = {
search: SearchIcon,
social: PodcastIcon,
email: MailIcon,
+ podcast: PodcastIcon,
+ comment: MessageCircleIcon,
unknown: HelpCircleIcon,
[NOT_SET_VALUE]: ScanIcon,
@@ -77,6 +80,10 @@ export function SerieIcon({ name, ...props }: SerieIconProps) {
return createImageIcon(getProxyImage(name));
}
+ if (name.match(/(.+)\.\w{2,3}$/)) {
+ return createImageIcon(getProxyImage(`https://${name}`));
+ }
+
return null;
}, [name]);
diff --git a/apps/dashboard/src/components/report/chart/SerieIcon.urls.ts b/apps/dashboard/src/components/report/chart/SerieIcon.urls.ts
index 6339d5ebe..d57450bc3 100644
--- a/apps/dashboard/src/components/report/chart/SerieIcon.urls.ts
+++ b/apps/dashboard/src/components/report/chart/SerieIcon.urls.ts
@@ -23,6 +23,8 @@ const data = {
ios: 'https://cdn0.iconfinder.com/data/icons/flat-round-system/512/apple-1024.png',
linkedin: 'https://linkedin.com',
linux: 'https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg',
+ ubuntu: 'https://upload.wikimedia.org/wikipedia/commons/a/ab/Logo-ubuntu_cof-orange-hex.svg',
+ weibo: 'https://en.wikipedia.org/wiki/Weibo#/media/File:Sina_Weibo.svg',
microlaunch: 'https://microlaunch.net',
openalternative: 'https://openalternative.co',
opera: 'https://upload.wikimedia.org/wikipedia/commons/thumb/4/49/Opera_2015_icon.svg/1920px-Opera_2015_icon.svg.png',
@@ -37,6 +39,18 @@ const data = {
windows: 'https://upload.wikimedia.org/wikipedia/commons/c/c7/Windows_logo_-_2012.png',
yandex: 'https://yandex.com',
youtube: 'https://youtube.com',
+ ossgallery: 'https://oss.gallery',
+ convertkit: 'https://convertkit.com',
+ whatsapp: 'https://www.whatsapp.com/',
+ telegram: 'https://telegram.org/',
+ tiktok: 'https://tiktok.com',
+ sharpspring: 'https://sharpspring.com',
+ 'hacker news': 'https://news.ycombinator.com',
+ 'betalist': 'https://betalist.com',
+ 'qwant': 'https://www.qwant.com',
+ flipboard: 'https://flipboard.com/',
+ trustpilot: 'https://trustpilot.com',
+ 'outlook.com': 'https://login.live.com/',
};
export default data;
diff --git a/apps/worker/src/utils/parse-referrer.ts b/apps/worker/src/utils/parse-referrer.ts
index adec1df98..7f035bb64 100644
--- a/apps/worker/src/utils/parse-referrer.ts
+++ b/apps/worker/src/utils/parse-referrer.ts
@@ -38,9 +38,10 @@ export function getReferrerWithQuery(
return null;
}
- const match = Object.values(referrers).find(
- (referrer) => referrer.name.toLowerCase() === source.toLowerCase()
- );
+ const match =
+ Object.values(referrers).find(
+ (referrer) => referrer.name.toLowerCase() === source.toLowerCase()
+ ) || referrers[source];
if (match) {
return {