mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 23:57:12 +01:00
Updated test console. Refactored fetch for tracker.
This commit is contained in:
commit
bc75b622b5
4 changed files with 106 additions and 122 deletions
|
|
@ -2,11 +2,13 @@ import React from 'react';
|
|||
import Layout from 'components/layout/Layout';
|
||||
import TestConsole from 'components/pages/TestConsole';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
import useUser from 'hooks/useUser';
|
||||
|
||||
export default function TestPage() {
|
||||
export default function ConsolePage({ enabled }) {
|
||||
const { loading } = useRequireLogin();
|
||||
const { user } = useUser();
|
||||
|
||||
if (loading) {
|
||||
if (loading || !enabled || !user?.is_admin) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -16,3 +18,9 @@ export default function TestPage() {
|
|||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export async function getServerSideProps() {
|
||||
return {
|
||||
props: { enabled: !!process.env.ENABLE_TEST_CONSOLE },
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue