diff --git a/next.config.js b/next.config.js index 09d99c9..aea67bb 100644 --- a/next.config.js +++ b/next.config.js @@ -11,6 +11,14 @@ module.exports = { }, ]; }, + webpack(config) { + config.resolve.fallback = { + ...config.resolve.fallback, + fs: false, // the solution + }; + + return config; + }, poweredByHeader: false, reactStrictMode: true, }; \ No newline at end of file diff --git a/package.json b/package.json index 2a9d625..2275322 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zipline", - "version": "3.4.0", + "version": "3.5.1", "license": "MIT", "scripts": { "dev": "REACT_EDITOR=code NODE_ENV=development tsx src/server", diff --git a/prisma/seed.ts b/prisma/seed.ts deleted file mode 100644 index c7bb148..0000000 --- a/prisma/seed.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { PrismaClient } from '@prisma/client'; -import { hashPassword, createToken } from '../src/lib/util'; - -const prisma = new PrismaClient(); - -async function main() { - const user = await prisma.user.create({ - data: { - username: 'administrator', - password: await hashPassword('password'), - token: createToken(), - administrator: true, - }, - }); - - console.log(` -When logging into Zipline for the first time, use these credentials: - -Username: "${user.username}" -Password: "password" -`); -} - -main() - .catch(e => { - console.error(e); - process.exit(1); - }) - .finally(async () => { - await prisma.$disconnect(); - }); \ No newline at end of file diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index fdaeb6d..621b5a2 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -8,7 +8,7 @@ import { useStoreDispatch } from 'lib/redux/store'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { useEffect, useState } from 'react'; -import { ActivityIcon, CheckIcon, CopyIcon, CrossIcon, DeleteIcon, FileIcon, HomeIcon, LinkIcon, LogoutIcon, PencilIcon, SettingsIcon, TagIcon, TypeIcon, UploadIcon, UserIcon } from './icons'; +import { ExternalLinkIcon, ActivityIcon, CheckIcon, CopyIcon, CrossIcon, DeleteIcon, FileIcon, HomeIcon, LinkIcon, LogoutIcon, PencilIcon, SettingsIcon, TagIcon, TypeIcon, UploadIcon, UserIcon } from './icons'; import { friendlyThemeName, themes } from './Theming'; function MenuItemLink(props) { @@ -22,7 +22,7 @@ function MenuItemLink(props) { function MenuItem(props) { return ( ({ + sx={theme => ({ display: 'block', width: '100%', padding: 5, @@ -31,7 +31,7 @@ function MenuItem(props) { ? theme.fn.themeColor(props.color, theme.colorScheme === 'dark' ? 5 : 7) : theme.colorScheme === 'dark' ? theme.colors.dark[0] - : theme.black, + : theme.black, '&:hover': { backgroundColor: props.color ? theme.fn.rgba( @@ -108,13 +108,16 @@ const admin_items = [ }, ]; -export default function Layout({ children, user, title }) { +export default function Layout({ children, user, props }) { + const { title } = props; + const external_links = JSON.parse(props.external_links ?? '[]'); + const [token, setToken] = useState(user?.token); const [systemTheme, setSystemTheme] = useState(user.systemTheme ?? 'system'); const [version, setVersion] = useState<{ local: string, upstream: string }>(null); const [opened, setOpened] = useState(false); // navigation open const [open, setOpen] = useState(false); // manage acc dropdown - + const avatar = user?.avatar ?? null; const router = useRouter(); const dispatch = useStoreDispatch(); @@ -248,6 +251,19 @@ export default function Layout({ children, user, title }) { )} + + {external_links.length ? external_links.map(({ label, link }, i) => ( + + } + /> + + )) : null} + {version ? ( } href='/dashboard/manage'>Manage Account - } onClick={() => {setOpen(false);openCopyToken();}}>Copy Token - } onClick={() => {setOpen(false);openResetToken();}} color='red'>Reset Token + } onClick={() => { setOpen(false); openCopyToken(); }}>Copy Token + } onClick={() => { setOpen(false); openResetToken(); }} color='red'>Reset Token } href='/auth/logout' color='red'>Logout }> -