mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 21:57:16 +01:00
Added external links for pages.
This commit is contained in:
parent
442ad61779
commit
9f73aba900
5 changed files with 25 additions and 9 deletions
|
|
@ -17,6 +17,7 @@ import styles from './MetricsTable.module.css';
|
|||
|
||||
export interface MetricsTableProps extends ListTableProps {
|
||||
websiteId: string;
|
||||
domainName: string;
|
||||
type?: string;
|
||||
className?: string;
|
||||
dataFilter?: (data: any) => any;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export interface PagesTableProps extends MetricsTableProps {
|
|||
allowFilter?: boolean;
|
||||
}
|
||||
|
||||
export function PagesTable({ allowFilter, ...props }: PagesTableProps) {
|
||||
export function PagesTable({ allowFilter, domainName, ...props }: PagesTableProps) {
|
||||
const {
|
||||
router,
|
||||
makeUrl,
|
||||
|
|
@ -17,7 +17,7 @@ export function PagesTable({ allowFilter, ...props }: PagesTableProps) {
|
|||
} = useNavigation();
|
||||
const { formatMessage, labels } = useMessages();
|
||||
|
||||
const handleSelect = key => {
|
||||
const handleSelect = (key: any) => {
|
||||
router.push(makeUrl({ view: key }), { scroll: true });
|
||||
};
|
||||
|
||||
|
|
@ -33,12 +33,20 @@ export function PagesTable({ allowFilter, ...props }: PagesTableProps) {
|
|||
];
|
||||
|
||||
const renderLink = ({ x }) => {
|
||||
return <FilterLink id={view} value={x} label={!x && formatMessage(labels.none)} />;
|
||||
return (
|
||||
<FilterLink
|
||||
id={view}
|
||||
value={x}
|
||||
label={!x && formatMessage(labels.none)}
|
||||
externalUrl={`${domainName.startsWith('http') ? domainName : `https://${domainName}`}${x}`}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<MetricsTable
|
||||
{...props}
|
||||
domainName={domainName}
|
||||
title={formatMessage(labels.pages)}
|
||||
type={view}
|
||||
metric={formatMessage(labels.views)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue