mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 01:25:37 +01:00
Teams context settings.
This commit is contained in:
parent
4429198397
commit
8f853ddb97
77 changed files with 317 additions and 272 deletions
|
|
@ -2,11 +2,11 @@
|
|||
import WebsitesDataTable from '../settings/websites/WebsitesDataTable';
|
||||
import { useLogin } from 'components/hooks';
|
||||
|
||||
export function WebsitesBrowse() {
|
||||
export function WebsitesBrowse({ teamId, userId }: { teamId: string; userId: string }) {
|
||||
const { user } = useLogin();
|
||||
const allowEdit = !process.env.cloudMode;
|
||||
|
||||
return <WebsitesDataTable userId={user.id} allowEdit={allowEdit} />;
|
||||
return <WebsitesDataTable teamId={teamId} userId={userId || user.id} allowEdit={allowEdit} />;
|
||||
}
|
||||
|
||||
export default WebsitesBrowse;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { getDateArray } from 'lib/date';
|
|||
|
||||
export function WebsiteChart({ websiteId }: { websiteId: string }) {
|
||||
const [dateRange] = useDateRange(websiteId);
|
||||
const { startDate, endDate, unit, modified } = dateRange;
|
||||
const { startDate, endDate, unit } = dateRange;
|
||||
const [timezone] = useTimezone();
|
||||
const {
|
||||
query: { url, referrer, os, browser, device, country, region, city, title },
|
||||
|
|
@ -15,7 +15,7 @@ export function WebsiteChart({ websiteId }: { websiteId: string }) {
|
|||
const { data, isLoading } = useQuery({
|
||||
queryKey: [
|
||||
'websites:pageviews',
|
||||
{ websiteId, modified, url, referrer, os, browser, device, country, region, city, title },
|
||||
{ websiteId, url, referrer, os, browser, device, country, region, city, title },
|
||||
],
|
||||
queryFn: () =>
|
||||
get(`/websites/${websiteId}/pageviews`, {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ export function WebsiteMetricsBar({
|
|||
const { formatMessage, labels } = useMessages();
|
||||
const { get, useQuery } = useApi();
|
||||
const [dateRange] = useDateRange(websiteId);
|
||||
const { startDate, endDate, modified } = dateRange;
|
||||
const { startDate, endDate } = dateRange;
|
||||
const { ref, isSticky } = useSticky({ enabled: sticky });
|
||||
const {
|
||||
query: { url, referrer, title, os, browser, device, country, region, city },
|
||||
|
|
@ -28,7 +28,7 @@ export function WebsiteMetricsBar({
|
|||
const { data, error, isLoading, isFetched } = useQuery({
|
||||
queryKey: [
|
||||
'websites:stats',
|
||||
{ websiteId, modified, url, referrer, title, os, browser, device, country, region, city },
|
||||
{ websiteId, url, referrer, title, os, browser, device, country, region, city },
|
||||
],
|
||||
queryFn: () =>
|
||||
get(`/websites/${websiteId}/stats`, {
|
||||
|
|
|
|||
|
|
@ -2,15 +2,15 @@ import WebsitesHeader from 'app/(main)/settings/websites/WebsitesHeader';
|
|||
import WebsitesBrowse from './WebsitesBrowse';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function WebsitesPage() {
|
||||
export default function WebsitesPage({ params: { teamId, userId } }) {
|
||||
return (
|
||||
<>
|
||||
<WebsitesHeader showActions={false} />
|
||||
<WebsitesBrowse />
|
||||
<WebsitesBrowse teamId={teamId} userId={userId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Websites | umami',
|
||||
title: 'Websites | Umami',
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue