mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 18:00:17 +01:00
Cleaned up pages. Fixed SSO page.
This commit is contained in:
parent
3720a5a2fc
commit
5e3c135388
@ -1,4 +1,5 @@
|
|||||||
import TestConsole from '../TestConsole';
|
import TestConsole from '../TestConsole';
|
||||||
|
import { Metadata } from 'next';
|
||||||
|
|
||||||
async function getEnabled() {
|
async function getEnabled() {
|
||||||
return !!process.env.ENABLE_TEST_CONSOLE;
|
return !!process.env.ENABLE_TEST_CONSOLE;
|
||||||
@ -13,3 +14,7 @@ export default async function ConsolePage() {
|
|||||||
|
|
||||||
return <TestConsole />;
|
return <TestConsole />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: 'Test Console | umami',
|
||||||
|
};
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import Dashboard from 'app/(app)/dashboard/Dashboard';
|
import Dashboard from 'app/(app)/dashboard/Dashboard';
|
||||||
import { Metadata } from 'next';
|
import { Metadata } from 'next';
|
||||||
|
|
||||||
export default function () {
|
export default function DashboardPage() {
|
||||||
return <Dashboard />;
|
return <Dashboard />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import InsightsReport from './InsightsReport';
|
import InsightsReport from './InsightsReport';
|
||||||
import { Metadata } from 'next';
|
import { Metadata } from 'next';
|
||||||
|
|
||||||
export default function () {
|
export default function InsightsReportPage() {
|
||||||
return <InsightsReport reportId={null} />;
|
return <InsightsReport reportId={null} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import RetentionReport from './RetentionReport';
|
import RetentionReport from './RetentionReport';
|
||||||
|
|
||||||
export default function () {
|
export default function RetentionReportPage() {
|
||||||
return <RetentionReport reportId={null} />;
|
return <RetentionReport reportId={null} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
30
src/app/(app)/websites/WebsitesBrowse.js
Normal file
30
src/app/(app)/websites/WebsitesBrowse.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
'use client';
|
||||||
|
import WebsiteList from 'app/(app)/settings/websites/WebsitesList';
|
||||||
|
import { useMessages } from 'components/hooks';
|
||||||
|
import { useState } from 'react';
|
||||||
|
import { Item, Tabs } from 'react-basics';
|
||||||
|
|
||||||
|
const TABS = {
|
||||||
|
myWebsites: 'my-websites',
|
||||||
|
teamWebsites: 'team-websites',
|
||||||
|
};
|
||||||
|
|
||||||
|
export function WebsitesBrowse() {
|
||||||
|
const { formatMessage, labels } = useMessages();
|
||||||
|
const [tab, setTab] = useState(TABS.myWebsites);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Tabs selectedKey={tab} onSelect={setTab} style={{ marginBottom: 30 }}>
|
||||||
|
<Item key={TABS.myWebsites}>{formatMessage(labels.myWebsites)}</Item>
|
||||||
|
<Item key={TABS.teamWebsites}>{formatMessage(labels.teamWebsites)}</Item>
|
||||||
|
</Tabs>
|
||||||
|
{tab === TABS.myWebsites && <WebsiteList showHeader={false} />}
|
||||||
|
{tab === TABS.teamWebsites && (
|
||||||
|
<WebsiteList showHeader={false} showTeam={true} onlyTeams={true} />
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default WebsitesBrowse;
|
@ -1,7 +1,7 @@
|
|||||||
import WebsiteHeader from '../WebsiteHeader';
|
import WebsiteHeader from '../WebsiteHeader';
|
||||||
import WebsiteEventData from './WebsiteEventData';
|
import WebsiteEventData from './WebsiteEventData';
|
||||||
|
|
||||||
export default function ({ params: { id } }) {
|
export default function WebsiteEventDataPage({ params: { id } }) {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
import WebsiteDetails from './WebsiteDetails';
|
import WebsiteDetails from './WebsiteDetails';
|
||||||
|
|
||||||
export default function ({ params: { id } }) {
|
export default function WebsiteReportsPage({ params: { id } }) {
|
||||||
if (!id) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return <WebsiteDetails websiteId={id} />;
|
return <WebsiteDetails websiteId={id} />;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import Realtime from './Realtime';
|
import Realtime from './Realtime';
|
||||||
|
|
||||||
export default function ({ params: { id } }) {
|
export default function WebsiteRealtimePage({ params: { id } }) {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1,30 +1,12 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import WebsiteList from 'app/(app)/settings/websites/WebsitesList';
|
|
||||||
import { useMessages } from 'components/hooks';
|
|
||||||
import { useState } from 'react';
|
|
||||||
import { Item, Tabs } from 'react-basics';
|
|
||||||
import WebsitesHeader from '../settings/websites/WebsitesHeader';
|
import WebsitesHeader from '../settings/websites/WebsitesHeader';
|
||||||
|
import WebsitesBrowse from './WebsitesBrowse';
|
||||||
const TABS = {
|
|
||||||
myWebsites: 'my-websites',
|
|
||||||
teamWebsites: 'team-websites',
|
|
||||||
};
|
|
||||||
|
|
||||||
export default function WebsitesPage() {
|
export default function WebsitesPage() {
|
||||||
const { formatMessage, labels } = useMessages();
|
|
||||||
const [tab, setTab] = useState(TABS.myWebsites);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<WebsitesHeader />
|
<WebsitesHeader />
|
||||||
<Tabs selectedKey={tab} onSelect={setTab} style={{ marginBottom: 30 }}>
|
<WebsitesBrowse />
|
||||||
<Item key={TABS.myWebsites}>{formatMessage(labels.myWebsites)}</Item>
|
|
||||||
<Item key={TABS.teamWebsites}>{formatMessage(labels.teamWebsites)}</Item>
|
|
||||||
</Tabs>
|
|
||||||
{tab === TABS.myWebsites && <WebsiteList showHeader={false} />}
|
|
||||||
{tab === TABS.teamWebsites && (
|
|
||||||
<WebsiteList showHeader={false} showTeam={true} onlyTeams={true} />
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
import Share from './Share';
|
import Share from './Share';
|
||||||
|
|
||||||
export default function ({ params: { id } }) {
|
export default function ({ params: { id } }) {
|
||||||
if (!id) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return <Share shareId={id} />;
|
return <Share shareId={id} />;
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { Loading } from 'react-basics';
|
import { Loading } from 'react-basics';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter, useSearchParams } from 'next/navigation';
|
||||||
import { setClientAuthToken } from 'lib/client';
|
import { setClientAuthToken } from 'lib/client';
|
||||||
|
|
||||||
export default function ({ params }) {
|
export default function SSOPage() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { token, url } = params;
|
const search = useSearchParams();
|
||||||
|
const url = search.get('url');
|
||||||
|
const token = search.get('token');
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (url && token) {
|
if (url && token) {
|
||||||
|
Loading…
Reference in New Issue
Block a user