mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 01:46:58 +01:00
Added external links for pages.
This commit is contained in:
parent
442ad61779
commit
9f73aba900
@ -33,8 +33,8 @@ export default function WebsiteDetails({ websiteId }: { websiteId: string }) {
|
||||
{!website && <Loading icon="dots" style={{ minHeight: 300 }} />}
|
||||
{website && (
|
||||
<>
|
||||
{!view && <WebsiteTableView websiteId={websiteId} />}
|
||||
{view && <WebsiteExpandedView websiteId={websiteId} />}
|
||||
{!view && <WebsiteTableView websiteId={websiteId} domainName={website.domain} />}
|
||||
{view && <WebsiteExpandedView websiteId={websiteId} domainName={website.domain} />}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
@ -35,10 +35,10 @@ const views = {
|
||||
|
||||
export default function WebsiteExpandedView({
|
||||
websiteId,
|
||||
websiteDomain,
|
||||
domainName,
|
||||
}: {
|
||||
websiteId: string;
|
||||
websiteDomain?: string;
|
||||
domainName?: string;
|
||||
}) {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const {
|
||||
@ -143,7 +143,7 @@ export default function WebsiteExpandedView({
|
||||
<div className={styles.content}>
|
||||
<DetailsComponent
|
||||
websiteId={websiteId}
|
||||
websiteDomain={websiteDomain}
|
||||
domainName={domainName}
|
||||
animate={false}
|
||||
virtualize={true}
|
||||
itemCount={25}
|
||||
|
@ -10,10 +10,17 @@ import CountriesTable from 'components/metrics/CountriesTable';
|
||||
import EventsTable from 'components/metrics/EventsTable';
|
||||
import EventsChart from 'components/metrics/EventsChart';
|
||||
|
||||
export default function WebsiteTableView({ websiteId }: { websiteId: string }) {
|
||||
export default function WebsiteTableView({
|
||||
websiteId,
|
||||
domainName,
|
||||
}: {
|
||||
websiteId: string;
|
||||
domainName: string;
|
||||
}) {
|
||||
const [countryData, setCountryData] = useState();
|
||||
const tableProps = {
|
||||
websiteId,
|
||||
domainName,
|
||||
limit: 10,
|
||||
};
|
||||
|
||||
|
@ -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…
Reference in New Issue
Block a user