mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
feat: add host
This commit is contained in:
parent
a38baa50af
commit
7152b0b76d
11 changed files with 61 additions and 5 deletions
35
src/components/metrics/HostsTable.tsx
Normal file
35
src/components/metrics/HostsTable.tsx
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import MetricsTable, { MetricsTableProps } from './MetricsTable';
|
||||
import FilterLink from 'components/common/FilterLink';
|
||||
import { useMessages } from 'components/hooks';
|
||||
import { Flexbox } from 'react-basics';
|
||||
|
||||
export function HostsTable(props: MetricsTableProps) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
const renderLink = ({ x: host }) => {
|
||||
return (
|
||||
<Flexbox alignItems="center">
|
||||
<FilterLink
|
||||
id="host"
|
||||
value={host}
|
||||
externalUrl={`https://${host}`}
|
||||
label={!host && formatMessage(labels.none)}
|
||||
/>
|
||||
</Flexbox>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<MetricsTable
|
||||
{...props}
|
||||
title={formatMessage(labels.hosts)}
|
||||
type="host"
|
||||
metric={formatMessage(labels.views)}
|
||||
renderLabel={renderLink}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default HostsTable;
|
||||
|
|
@ -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, host, 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,
|
||||
host,
|
||||
os,
|
||||
title,
|
||||
browser,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue