mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Messages for devices so they can be localized.
This commit is contained in:
parent
c707b49400
commit
2d9523f963
19 changed files with 111 additions and 39 deletions
|
|
@ -54,13 +54,6 @@ export const DESKTOP_OS = [
|
|||
|
||||
export const MOBILE_OS = ['iOS', 'Android OS', 'BlackBerry OS', 'Windows Mobile', 'Amazon OS'];
|
||||
|
||||
export const DEVICES = {
|
||||
desktop: 'Desktop',
|
||||
laptop: 'Laptop',
|
||||
tablet: 'Tablet',
|
||||
mobile: 'Mobile',
|
||||
};
|
||||
|
||||
export const BROWSERS = {
|
||||
aol: 'AOL',
|
||||
edge: 'Edge',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import firstBy from 'thenby';
|
||||
import { BROWSERS, ISO_COUNTRIES, DEVICES } from './constants';
|
||||
import { BROWSERS, ISO_COUNTRIES } from './constants';
|
||||
import { removeTrailingSlash, getDomainName } from './url';
|
||||
|
||||
export const urlFilter = (data, { raw }) => {
|
||||
|
|
@ -118,15 +118,14 @@ export const refFilter = (data, { domain, domainOnly, raw }) => {
|
|||
};
|
||||
|
||||
export const browserFilter = data =>
|
||||
data.map(({ x, y }) => ({ x: BROWSERS[x], y })).filter(({ x }) => x);
|
||||
data.map(({ x, y }) => ({ x: BROWSERS[x] || x, y })).filter(({ x }) => x);
|
||||
|
||||
export const osFilter = data => data.filter(({ x }) => x);
|
||||
|
||||
export const deviceFilter = data =>
|
||||
data.map(({ x, y }) => ({ x: DEVICES[x], y })).filter(({ x }) => x);
|
||||
export const deviceFilter = data => data.filter(({ x }) => x);
|
||||
|
||||
export const countryFilter = data =>
|
||||
data.map(({ x, y }) => ({ x: ISO_COUNTRIES[x], y })).filter(({ x }) => x);
|
||||
data.map(({ x, y }) => ({ x: ISO_COUNTRIES[x] || x, y })).filter(({ x }) => x);
|
||||
|
||||
export const percentFilter = data => {
|
||||
const total = data.reduce((n, { y }) => n + y, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue