Merge branch 'dev' into add-umami

This commit is contained in:
Thomas Camlong
2023-10-26 12:40:46 +02:00
committed by GitHub
107 changed files with 432 additions and 375 deletions

View File

@@ -5,9 +5,8 @@ import Head from 'next/head';
import Image from 'next/image';
import Link from 'next/link';
import pageNotFoundImage from '~/images/undraw_page_not_found_re_e9o6.svg';
import { pageNotFoundNamespaces } from '~/tools/server/translation-namespaces';
import { getServerSideTranslations } from '~/tools/server/getServerSideTranslations';
import { pageNotFoundNamespaces } from '~/tools/server/translation-namespaces';
export default function Custom404() {
const { classes } = useStyles();
@@ -27,6 +26,9 @@ export default function Custom404() {
<Button component={Link} variant="light" href="/b">
{t('button')}
</Button>
<Button component={Link} variant="light" href="/auth/login">
Login
</Button>
</Stack>
</Center>
);

View File

@@ -22,6 +22,7 @@ import { useState } from 'react';
import { z } from 'zod';
import { ThemeSchemeToggle } from '~/components/ThemeSchemeToggle/ThemeSchemeToggle';
import { FloatingBackground } from '~/components/layout/Background/FloatingBackground';
import { env } from '~/env';
import { getServerAuthSession } from '~/server/auth';
import { getServerSideTranslations } from '~/tools/server/getServerSideTranslations';
import { useI18nZodResolver } from '~/utils/i18n-zod-resolver';
@@ -29,6 +30,7 @@ import { signInSchema } from '~/validations/user';
export default function LoginPage({
redirectAfterLogin,
isDemo,
}: InferGetServerSidePropsType<typeof getServerSideProps>) {
const { t } = useTranslation('authentication/login');
const { i18nZodResolver } = useI18nZodResolver();
@@ -86,6 +88,12 @@ export default function LoginPage({
Homarr
</Text>
</Stack>
{isDemo && (
<Alert title="Demo credentials">
For demo purposes, you can login with the login <b>demo</b> and password :{' '}
<b>demodemo</b>
</Alert>
)}
<Card withBorder shadow="md" p="xl" radius="md" w="90%" maw={450}>
<Title style={{ whiteSpace: 'nowrap' }} align="center" weight={900}>
{t('title')}
@@ -156,10 +164,13 @@ export const getServerSideProps: GetServerSideProps = async ({ locale, req, res,
};
}
const isDemo = env.DEMO_MODE === 'true';
return {
props: {
...(await getServerSideTranslations(['authentication/login'], locale, req, res)),
redirectAfterLogin,
isDemo,
},
};
};

View File

@@ -2,11 +2,11 @@ import {
Box,
Card,
Group,
Image,
SimpleGrid,
Stack,
Text,
Title,
Image,
UnstyledButton,
createStyles,
} from '@mantine/core';