feat(server, web): quotas (#4471)

* feat: quotas

* chore: open api

* chore: update status box and upload error message

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
cfitzw 2024-01-12 18:43:36 -06:00 committed by GitHub
parent f4edb6c4bd
commit deb1f970a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 646 additions and 118 deletions

View file

@ -4,6 +4,7 @@
import ImmichLogo from '../shared-components/immich-logo.svelte';
import { notificationController, NotificationType } from '../shared-components/notification/notification';
import Button from '../elements/buttons/button.svelte';
import { convertToBytes } from '$lib/utils/byte-converter';
let error: string;
let success: string;
@ -42,6 +43,7 @@
const email = form.get('email');
const password = form.get('password');
const name = form.get('name');
const quotaSize = form.get('quotaSize');
try {
const { status } = await api.userApi.createUser({
@ -49,6 +51,7 @@
email: String(email),
password: String(password),
name: String(name),
quotaSizeInBytes: quotaSize ? convertToBytes(Number(quotaSize), 'GiB') : null,
},
});
@ -117,6 +120,11 @@
<input class="immich-form-input" id="name" name="name" type="text" required />
</div>
<div class="m-4 flex flex-col gap-2">
<label class="immich-form-label" for="quotaSize">Quota Size (GB)</label>
<input class="immich-form-input" id="quotaSize" name="quotaSize" type="number" min="0" />
</div>
{#if error}
<p class="ml-4 text-sm text-red-400">{error}</p>
{/if}