mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01:00
fix region / city filters
This commit is contained in:
parent
672608b2f5
commit
43499eb4fd
@ -16,11 +16,14 @@ export default function MetricsBar({ websiteId }) {
|
||||
const { startDate, endDate, modified } = dateRange;
|
||||
const [format, setFormat] = useState(true);
|
||||
const {
|
||||
query: { url, referrer, os, browser, device, country },
|
||||
query: { url, referrer, os, browser, device, country, region, city },
|
||||
} = usePageQuery();
|
||||
|
||||
const { data, error, isLoading, isFetched } = useQuery(
|
||||
['websites:stats', { websiteId, modified, url, referrer, os, browser, device, country }],
|
||||
[
|
||||
'websites:stats',
|
||||
{ websiteId, modified, url, referrer, os, browser, device, country, region, city },
|
||||
],
|
||||
() =>
|
||||
get(`/websites/${websiteId}/stats`, {
|
||||
startAt: +startDate,
|
||||
@ -31,6 +34,8 @@ export default function MetricsBar({ websiteId }) {
|
||||
browser,
|
||||
device,
|
||||
country,
|
||||
region,
|
||||
city,
|
||||
}),
|
||||
);
|
||||
|
||||
|
@ -127,11 +127,11 @@ function parseFilters(
|
||||
params = [],
|
||||
sessionKey = 'session_id',
|
||||
) {
|
||||
const { os, browser, device, country, subdivision1, subdivision2, city } = filters;
|
||||
const { os, browser, device, country, region, city } = filters;
|
||||
|
||||
return {
|
||||
joinSession:
|
||||
os || browser || device || country || subdivision1 || subdivision2 || city
|
||||
os || browser || device || country || region || city
|
||||
? `inner join session on website_event.${sessionKey} = session.${sessionKey}`
|
||||
: '',
|
||||
filterQuery: getFilterQuery(filters, params),
|
||||
|
@ -82,8 +82,7 @@ export interface WebsiteMetricFilter {
|
||||
browser?: string;
|
||||
device?: string;
|
||||
country?: string;
|
||||
subdivision1?: string;
|
||||
subdivision2?: string;
|
||||
region?: string;
|
||||
city?: string;
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,7 @@ export interface WebsitePageviewRequestQuery {
|
||||
browser?: string;
|
||||
device?: string;
|
||||
country?: string;
|
||||
subdivision1?: string;
|
||||
subdivision2?: string;
|
||||
region: string;
|
||||
city?: string;
|
||||
}
|
||||
|
||||
@ -46,8 +45,7 @@ export default async (
|
||||
browser,
|
||||
device,
|
||||
country,
|
||||
subdivision1,
|
||||
subdivision2,
|
||||
region,
|
||||
city,
|
||||
} = req.query;
|
||||
|
||||
@ -78,8 +76,7 @@ export default async (
|
||||
browser,
|
||||
device,
|
||||
country,
|
||||
subdivision1,
|
||||
subdivision2,
|
||||
region,
|
||||
city,
|
||||
},
|
||||
}),
|
||||
@ -96,8 +93,7 @@ export default async (
|
||||
browser,
|
||||
device,
|
||||
country,
|
||||
subdivision1,
|
||||
subdivision2,
|
||||
region,
|
||||
city,
|
||||
},
|
||||
}),
|
||||
|
@ -18,8 +18,7 @@ export interface WebsiteStatsRequestQuery {
|
||||
browser: string;
|
||||
device: string;
|
||||
country: string;
|
||||
subdivision1: string;
|
||||
subdivision2: string;
|
||||
region: string;
|
||||
city: string;
|
||||
}
|
||||
|
||||
@ -43,8 +42,7 @@ export default async (
|
||||
browser,
|
||||
device,
|
||||
country,
|
||||
subdivision1,
|
||||
subdivision2,
|
||||
region,
|
||||
city,
|
||||
} = req.query;
|
||||
|
||||
@ -73,8 +71,7 @@ export default async (
|
||||
browser,
|
||||
device,
|
||||
country,
|
||||
subdivision1,
|
||||
subdivision2,
|
||||
region,
|
||||
city,
|
||||
},
|
||||
});
|
||||
@ -91,8 +88,7 @@ export default async (
|
||||
browser,
|
||||
device,
|
||||
country,
|
||||
subdivision1,
|
||||
subdivision2,
|
||||
region,
|
||||
city,
|
||||
},
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user