mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 00:27:11 +01:00
add DISABLE_UI, DISABLE_ADMIN
This commit is contained in:
parent
736f06442c
commit
99c975c329
13 changed files with 94 additions and 20 deletions
|
|
@ -4,11 +4,11 @@ import TestConsole from 'components/pages/TestConsole';
|
|||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
import useUser from 'hooks/useUser';
|
||||
|
||||
export default function ConsolePage({ enabled }) {
|
||||
export default function ConsolePage({ enabled, pageDisabled }) {
|
||||
const { loading } = useRequireLogin();
|
||||
const { user } = useUser();
|
||||
|
||||
if (loading || !enabled || !user?.isAdmin) {
|
||||
if (pageDisabled || loading || !enabled || !user?.isAdmin) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -21,6 +21,9 @@ export default function ConsolePage({ enabled }) {
|
|||
|
||||
export async function getServerSideProps() {
|
||||
return {
|
||||
props: { enabled: !!process.env.ENABLE_TEST_CONSOLE },
|
||||
props: {
|
||||
pageDisabled: !!process.env.DISABLE_UI,
|
||||
enabled: !!process.env.ENABLE_TEST_CONSOLE,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue