mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-16 02:05:04 +01:00
26 lines
527 B
JavaScript
26 lines
527 B
JavaScript
import Layout from 'components/layout/Layout';
|
|
import TestConsole from 'components/pages/TestConsole';
|
|
import useRequireLogin from 'hooks/useRequireLogin';
|
|
|
|
export default function ConsolePage({ pageDisabled }) {
|
|
const { user } = useRequireLogin();
|
|
|
|
if (pageDisabled || !user || !user.isAdmin) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<Layout>
|
|
<TestConsole />
|
|
</Layout>
|
|
);
|
|
}
|
|
|
|
export async function getServerSideProps() {
|
|
return {
|
|
props: {
|
|
pageDisabled: !process.env.ENABLE_TEST_CONSOLE,
|
|
},
|
|
};
|
|
}
|