mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 09:35:36 +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
|
|
@ -5,7 +5,7 @@ import useRequireLogin from 'hooks/useRequireLogin';
|
|||
import { useRouter } from 'next/router';
|
||||
import useUser from 'hooks/useUser';
|
||||
|
||||
export default function DashboardPage() {
|
||||
export default function DashboardPage({ pageDisabled }) {
|
||||
const {
|
||||
query: { id },
|
||||
isReady,
|
||||
|
|
@ -14,7 +14,7 @@ export default function DashboardPage() {
|
|||
const { loading } = useRequireLogin();
|
||||
const user = useUser();
|
||||
|
||||
if (!user || !isReady || loading) {
|
||||
if (pageDisabled || !user || !isReady || loading) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -26,3 +26,11 @@ export default function DashboardPage() {
|
|||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export async function getServerSideProps() {
|
||||
return {
|
||||
props: {
|
||||
pageDisabled: !!process.env.DISABLE_UI,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue