mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 04:25:39 +01:00
Merge pull request #1 from mathix420/feat/filter-by-query-param
feat: filter by query params
This commit is contained in:
commit
d05fadc654
6 changed files with 13 additions and 6 deletions
|
|
@ -16,7 +16,7 @@ export default function WebsiteDetails({ websiteId }: { websiteId: string }) {
|
|||
const showLinks = !pathname.includes('/share/');
|
||||
|
||||
const {
|
||||
query: { view, url, referrer, os, browser, device, country, region, city, title },
|
||||
query: { view, url, referrer, query, os, browser, device, country, region, city, title },
|
||||
} = useNavigation();
|
||||
|
||||
if (isLoading || error) {
|
||||
|
|
@ -26,7 +26,7 @@ export default function WebsiteDetails({ websiteId }: { websiteId: string }) {
|
|||
return (
|
||||
<>
|
||||
<WebsiteHeader websiteId={websiteId} showLinks={showLinks} />
|
||||
<FilterTags params={{ url, referrer, os, browser, device, country, region, city, title }} />
|
||||
<FilterTags params={{ url, referrer, query, os, browser, device, country, region, city, title }} />
|
||||
<WebsiteMetricsBar websiteId={websiteId} sticky={true} />
|
||||
<WebsiteChart websiteId={websiteId} />
|
||||
{!website && <Loading icon="dots" style={{ minHeight: 300 }} />}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ export function WebsiteFilterButton({
|
|||
const fieldOptions = [
|
||||
{ name: 'url', type: 'string', label: formatMessage(labels.url) },
|
||||
{ name: 'referrer', type: 'string', label: formatMessage(labels.referrer) },
|
||||
{ name: 'query', type: 'string', label: formatMessage(labels.query) },
|
||||
{ name: 'browser', type: 'string', label: formatMessage(labels.browser) },
|
||||
{ name: 'os', type: 'string', label: formatMessage(labels.os) },
|
||||
{ name: 'device', type: 'string', label: formatMessage(labels.device) },
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ export function useWebsitePageviews(websiteId: string, options?: { [key: string]
|
|||
const { startDate, endDate, unit } = dateRange;
|
||||
const [timezone] = useTimezone();
|
||||
const {
|
||||
query: { url, referrer, os, browser, device, country, region, city, title },
|
||||
query: { url, referrer, query, os, browser, device, country, region, city, title },
|
||||
} = useNavigation();
|
||||
|
||||
const params = {
|
||||
|
|
@ -16,6 +16,7 @@ export function useWebsitePageviews(websiteId: string, options?: { [key: string]
|
|||
timezone,
|
||||
url,
|
||||
referrer,
|
||||
query,
|
||||
os,
|
||||
browser,
|
||||
device,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ export function useWebsiteStats(websiteId: string, options?: { [key: string]: st
|
|||
const [dateRange] = useDateRange(websiteId);
|
||||
const { startDate, endDate } = dateRange;
|
||||
const {
|
||||
query: { url, referrer, title, os, browser, device, country, region, city },
|
||||
query: { url, referrer, query, title, os, browser, device, country, region, city },
|
||||
} = useNavigation();
|
||||
|
||||
const params = {
|
||||
|
|
@ -13,6 +13,7 @@ export function useWebsiteStats(websiteId: string, options?: { [key: string]: st
|
|||
endAt: +endDate,
|
||||
url,
|
||||
referrer,
|
||||
query,
|
||||
title,
|
||||
os,
|
||||
browser,
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ export function MetricsTable({
|
|||
const [{ startDate, endDate }] = useDateRange(websiteId);
|
||||
const {
|
||||
renderUrl,
|
||||
query: { url, referrer, title, os, browser, device, country, region, city },
|
||||
query: { url, referrer, query, title, os, browser, device, country, region, city },
|
||||
} = useNavigation();
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const { dir } = useLocale();
|
||||
|
|
@ -61,6 +61,7 @@ export function MetricsTable({
|
|||
endAt: +endDate,
|
||||
url,
|
||||
referrer,
|
||||
query,
|
||||
os,
|
||||
title,
|
||||
browser,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export interface WebsitePageviewRequestQuery {
|
|||
timezone?: string;
|
||||
url?: string;
|
||||
referrer?: string;
|
||||
query?: string;
|
||||
title?: string;
|
||||
os?: string;
|
||||
browser?: string;
|
||||
|
|
@ -34,6 +35,7 @@ const schema = {
|
|||
timezone: TimezoneTest,
|
||||
url: yup.string(),
|
||||
referrer: yup.string(),
|
||||
query: yup.string(),
|
||||
title: yup.string(),
|
||||
os: yup.string(),
|
||||
browser: yup.string(),
|
||||
|
|
@ -52,7 +54,7 @@ export default async (
|
|||
await useAuth(req, res);
|
||||
await useValidate(schema, req, res);
|
||||
|
||||
const { websiteId, timezone, url, referrer, title, os, browser, device, country, region, city } =
|
||||
const { websiteId, timezone, url, referrer, query, title, os, browser, device, country, region, city } =
|
||||
req.query;
|
||||
|
||||
if (req.method === 'GET') {
|
||||
|
|
@ -69,6 +71,7 @@ export default async (
|
|||
unit,
|
||||
url,
|
||||
referrer,
|
||||
query,
|
||||
title,
|
||||
os,
|
||||
browser,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue