mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 09:57:00 +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 { Metadata } from 'next';
|
||||
|
||||
async function getEnabled() {
|
||||
return !!process.env.ENABLE_TEST_CONSOLE;
|
||||
@ -13,3 +14,7 @@ export default async function ConsolePage() {
|
||||
|
||||
return <TestConsole />;
|
||||
}
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Test Console | umami',
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Dashboard from 'app/(app)/dashboard/Dashboard';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function () {
|
||||
export default function DashboardPage() {
|
||||
return <Dashboard />;
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import InsightsReport from './InsightsReport';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export default function () {
|
||||
export default function InsightsReportPage() {
|
||||
return <InsightsReport reportId={null} />;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import RetentionReport from './RetentionReport';
|
||||
|
||||
export default function () {
|
||||
export default function RetentionReportPage() {
|
||||
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 WebsiteEventData from './WebsiteEventData';
|
||||
|
||||
export default function ({ params: { id } }) {
|
||||
export default function WebsiteEventDataPage({ params: { id } }) {
|
||||
if (!id) {
|
||||
return null;
|
||||
}
|
||||
|
@ -1,9 +1,5 @@
|
||||
import WebsiteDetails from './WebsiteDetails';
|
||||
|
||||
export default function ({ params: { id } }) {
|
||||
if (!id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
export default function WebsiteReportsPage({ params: { id } }) {
|
||||
return <WebsiteDetails websiteId={id} />;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import Realtime from './Realtime';
|
||||
|
||||
export default function ({ params: { id } }) {
|
||||
export default function WebsiteRealtimePage({ params: { id } }) {
|
||||
if (!id) {
|
||||
return null;
|
||||
}
|
||||
|
@ -1,30 +1,12 @@
|
||||
'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';
|
||||
|
||||
const TABS = {
|
||||
myWebsites: 'my-websites',
|
||||
teamWebsites: 'team-websites',
|
||||
};
|
||||
import WebsitesBrowse from './WebsitesBrowse';
|
||||
|
||||
export default function WebsitesPage() {
|
||||
const { formatMessage, labels } = useMessages();
|
||||
const [tab, setTab] = useState(TABS.myWebsites);
|
||||
|
||||
return (
|
||||
<>
|
||||
<WebsitesHeader />
|
||||
<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} />
|
||||
)}
|
||||
<WebsitesBrowse />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
@ -1,9 +1,5 @@
|
||||
import Share from './Share';
|
||||
|
||||
export default function ({ params: { id } }) {
|
||||
if (!id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <Share shareId={id} />;
|
||||
}
|
||||
|
@ -1,12 +1,14 @@
|
||||
'use client';
|
||||
import { useEffect } from 'react';
|
||||
import { Loading } from 'react-basics';
|
||||
import { useRouter } from 'next/navigation';
|
||||
import { useRouter, useSearchParams } from 'next/navigation';
|
||||
import { setClientAuthToken } from 'lib/client';
|
||||
|
||||
export default function ({ params }) {
|
||||
export default function SSOPage() {
|
||||
const router = useRouter();
|
||||
const { token, url } = params;
|
||||
const search = useSearchParams();
|
||||
const url = search.get('url');
|
||||
const token = search.get('token');
|
||||
|
||||
useEffect(() => {
|
||||
if (url && token) {
|
||||
|
Loading…
Reference in New Issue
Block a user