mirror of
https://github.com/umami-software/umami.git
synced 2026-02-08 22:57:12 +01:00
Renamed id routes for API.
This commit is contained in:
parent
53a991176b
commit
4429198397
42 changed files with 154 additions and 170 deletions
|
|
@ -4,7 +4,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
|
|||
export function useWebsiteMetrics(
|
||||
websiteId: string,
|
||||
params?: { [key: string]: any },
|
||||
options?: Omit<UseQueryOptions, 'queryKey' | 'queryFn'>,
|
||||
options?: Omit<UseQueryOptions & { onDataLoad?: (data: any) => void }, 'queryKey' | 'queryFn'>,
|
||||
) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
||||
|
|
@ -25,6 +25,8 @@ export function useWebsiteMetrics(
|
|||
...filters,
|
||||
});
|
||||
|
||||
options?.onDataLoad?.(data);
|
||||
|
||||
return data;
|
||||
},
|
||||
...options,
|
||||
|
|
|
|||
|
|
@ -11,10 +11,9 @@ export interface DateFilterProps {
|
|||
value: string;
|
||||
startDate: Date;
|
||||
endDate: Date;
|
||||
offset: number;
|
||||
offset?: number;
|
||||
className?: string;
|
||||
onChange?: (value: string) => void;
|
||||
selectedUnit?: string;
|
||||
showAllTime?: boolean;
|
||||
alignment?: 'start' | 'center' | 'end';
|
||||
}
|
||||
|
|
@ -23,7 +22,7 @@ export function DateFilter({
|
|||
startDate,
|
||||
endDate,
|
||||
value,
|
||||
offset,
|
||||
offset = 0,
|
||||
className,
|
||||
onChange,
|
||||
showAllTime = false,
|
||||
|
|
|
|||
|
|
@ -1,19 +1,21 @@
|
|||
import { ReactNode, useMemo, useState } from 'react';
|
||||
import { Loading, Icon, Text, SearchField } from 'react-basics';
|
||||
import classNames from 'classnames';
|
||||
import { percentFilter } from 'lib/filters';
|
||||
import { useDateRange } from 'components/hooks';
|
||||
import { useNavigation } from 'components/hooks';
|
||||
import ErrorMessage from 'components/common/ErrorMessage';
|
||||
import LinkButton from 'components/common/LinkButton';
|
||||
import ListTable, { ListTableProps } from './ListTable';
|
||||
import { DEFAULT_ANIMATION_DURATION } from 'lib/constants';
|
||||
import { percentFilter } from 'lib/filters';
|
||||
import {
|
||||
useDateRange,
|
||||
useNavigation,
|
||||
useWebsiteMetrics,
|
||||
useMessages,
|
||||
useLocale,
|
||||
useFormat,
|
||||
} from 'components/hooks';
|
||||
import Icons from 'components/icons';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import { useLocale } from 'components/hooks';
|
||||
import useFormat from 'components//hooks/useFormat';
|
||||
import ListTable, { ListTableProps } from './ListTable';
|
||||
import styles from './MetricsTable.module.css';
|
||||
import useWebsiteMetrics from 'components/hooks/queries/useWebsiteMetrics';
|
||||
|
||||
export interface MetricsTableProps extends ListTableProps {
|
||||
websiteId: string;
|
||||
|
|
@ -67,7 +69,7 @@ export function MetricsTable({
|
|||
region,
|
||||
city,
|
||||
},
|
||||
{ retryDelay: delay || DEFAULT_ANIMATION_DURATION },
|
||||
{ retryDelay: delay || DEFAULT_ANIMATION_DURATION, onDataLoad },
|
||||
);
|
||||
|
||||
const filteredData = useMemo(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue