1
Fork 0
mirror of https://github.com/diced/zipline.git synced 2025-04-11 23:31:17 -05:00

Merge branch 'trunk' into patch-1

This commit is contained in:
dicedtomato 2025-03-03 15:54:10 -08:00 committed by GitHub
commit 47434f5690
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 109 additions and 26 deletions

View file

@ -4,14 +4,14 @@
"license": "MIT",
"version": "4.0.0",
"scripts": {
"build": "pnpm run --stream \"/^build:.*/\"",
"build": "cross-env pnpm run --stream \"/^build:.*/\"",
"build:prisma": "prisma generate --no-hints",
"build:next": "ZIPLINE_BUILD=true next build",
"build:server": "tsup",
"dev": "TURBOPACK=1 NODE_ENV=development DEBUG=zipline tsx --require dotenv/config --enable-source-maps ./src/server",
"dev:inspector": "TURBOPACK=1 NODE_ENV=development DEBUG=zipline tsx --require dotenv/config --inspect=0.0.0.0:9229 --enable-source-maps ./src/server",
"start": "NODE_ENV=production node --trace-warnings --require dotenv/config --enable-source-maps ./build/server",
"start:inspector": "NODE_ENV=production node --require dotenv/config --inspect=0.0.0.0:9229 --enable-source-maps ./build/server",
"dev": "cross-env TURBOPACK=1 NODE_ENV=development DEBUG=zipline tsx --require dotenv/config --enable-source-maps ./src/server",
"dev:inspector": "cross-env TURBOPACK=1 NODE_ENV=development DEBUG=zipline tsx --require dotenv/config --inspect=0.0.0.0:9229 --enable-source-maps ./src/server",
"start": "cross-env NODE_ENV=production node --trace-warnings --require dotenv/config --enable-source-maps ./build/server",
"start:inspector": "cross-env NODE_ENV=production node --require dotenv/config --inspect=0.0.0.0:9229 --enable-source-maps ./build/server",
"ctl": "NODE_ENV=production node --require dotenv/config --enable-source-maps ./build/ctl",
"validate": "pnpm run --stream \"/^validate:.*/\"",
"validate:lint": "eslint --cache --fix .",
@ -47,6 +47,7 @@
"clsx": "^2.1.1",
"colorette": "^2.0.20",
"commander": "^13.1.0",
"cross-env": "^7.0.3",
"dayjs": "^1.11.13",
"dotenv": "^16.4.7",
"express": "^4.21.2",

12
pnpm-lock.yaml generated
View file

@ -89,6 +89,9 @@ importers:
commander:
specifier: ^13.1.0
version: 13.1.0
cross-env:
specifier: ^7.0.3
version: 7.0.3
dayjs:
specifier: ^1.11.13
version: 1.11.13
@ -2192,6 +2195,11 @@ packages:
core-util-is@1.0.3:
resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==}
cross-env@7.0.3:
resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==}
engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'}
hasBin: true
cross-spawn@7.0.6:
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
engines: {node: '>= 8'}
@ -6916,6 +6924,10 @@ snapshots:
core-util-is@1.0.3: {}
cross-env@7.0.3:
dependencies:
cross-spawn: 7.0.6
cross-spawn@7.0.6:
dependencies:
path-key: 3.1.1

View file

@ -8,6 +8,8 @@ import {
Button,
Center,
Checkbox,
Divider,
Image,
LoadingOverlay,
Paper,
PasswordInput,
@ -18,7 +20,7 @@ import {
} from '@mantine/core';
import { useForm } from '@mantine/form';
import { notifications } from '@mantine/notifications';
import { IconPlus, IconX } from '@tabler/icons-react';
import { IconPlus, IconX, IconUserPlus, IconLogin } from '@tabler/icons-react';
import { InferGetServerSidePropsType } from 'next';
import Link from 'next/link';
import { useRouter } from 'next/router';
@ -98,28 +100,75 @@ export default function Register({ config, invite }: InferGetServerSidePropsType
return (
<>
<Center h='100vh'>
<Paper withBorder p='sm'>
{invite ? (
<div>
<Title order={4} fw={500}>
You have been invited to join <b>{config?.website?.title ?? 'Zipline'}</b> by{' '}
<b>{invite.inviter!.username}</b>
</Title>
</div>
) : (
<Title order={4} fw={500}>
Register for <b>{config?.website?.title ?? 'Zipline'}</b>
</Title>
)}
{config.website.loginBackground && (
<Image
src={config.website.loginBackground}
alt={config.website.loginBackground + ' failed to load'}
style={{
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
width: '100%',
height: '100%',
objectFit: 'cover',
...(config.website.loginBackgroundBlur && { filter: 'blur(10px)' }),
}}
/>
)}
<Text size='sm' c='dimmed'>
Create an account to get started.
</Text>
<Paper
w='350px'
p='xl'
shadow='xl'
withBorder
style={{
backgroundColor: config.website.loginBackground ? 'rgba(0, 0, 0, 0)' : undefined,
backdropFilter: config.website.loginBackgroundBlur ? 'blur(35px)' : undefined,
}}
>
<div style={{ width: '100%', overflowWrap: 'break-word' }}>
<Title
order={1}
size={(config.website.title ?? 'Zipline').length > 50 ? 20 : 50}
ta='center'
style={{ whiteSpace: 'normal' }}
>
<b>{config.website.title ?? 'Zipline'}</b>
</Title>
</div>
{invite ? (
<Text ta='center' size='sm' c='dimmed'>
You have been invited to join <b>{config?.website?.title ?? 'Zipline'}</b> by{' '}
<b>{invite.inviter!.username}</b>
</Text>
) : null}
<form onSubmit={form.onSubmit(onSubmit)}>
<Stack gap='sm'>
<TextInput label='Username' placeholder='Username' {...form.getInputProps('username')} />
<PasswordInput label='Password' placeholder='Password' {...form.getInputProps('password')} />
<Stack my='sm'>
<TextInput
size='md'
placeholder='Enter your username...'
styles={{
input: {
backgroundColor: config.website.loginBackground ? 'transparent' : undefined,
},
}}
{...form.getInputProps('username', { withError: true })}
/>
<PasswordInput
size='md'
placeholder='Enter your password...'
styles={{
input: {
backgroundColor: config.website.loginBackground ? 'transparent' : undefined,
},
}}
{...form.getInputProps('password')}
/>
{config.website.tos && (
<Checkbox
@ -136,11 +185,32 @@ export default function Register({ config, invite }: InferGetServerSidePropsType
/>
)}
<Button type='submit' fullWidth leftSection={<IconPlus size='1rem' />}>
<Button
size='md'
fullWidth
type='submit'
variant={config.website.loginBackground ? 'outline' : 'filled'}
leftSection={<IconUserPlus size='1rem' />}
>
Register
</Button>
</Stack>
</form>
<Stack my='xs'>
<Divider label='or' />
<Button
component={Link}
href='/auth/login'
size='md'
fullWidth
variant='outline'
leftSection={<IconLogin size='1rem' />}
>
Login
</Button>
</Stack>
</Paper>
</Center>
</>