mirror of
https://github.com/immich-app/immich.git
synced 2025-11-15 23:52:38 +09:00
feat(web): add warning when setting a quota superior to the disk size (#6737)
* refactor: inline warning * fix: do not use onmount * chore: remove outdated comment * wording --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import { notificationController, NotificationType } from '../shared-components/notification/notification';
|
||||
import Button from '../elements/buttons/button.svelte';
|
||||
import { convertToBytes } from '$lib/utils/byte-converter';
|
||||
import { serverInfo } from '$lib/stores/server-info.store';
|
||||
|
||||
let error: string;
|
||||
let success: string;
|
||||
@@ -13,9 +14,11 @@
|
||||
let confirmPassowrd = '';
|
||||
|
||||
let canCreateUser = false;
|
||||
|
||||
let quotaSize: number | undefined = undefined;
|
||||
let isCreatingUser = false;
|
||||
|
||||
$: quotaSizeWarning = quotaSize && convertToBytes(Number(quotaSize), 'GiB') > $serverInfo.diskSizeRaw;
|
||||
|
||||
$: {
|
||||
if (password !== confirmPassowrd && confirmPassowrd.length > 0) {
|
||||
error = 'Password does not match';
|
||||
@@ -121,8 +124,12 @@
|
||||
</div>
|
||||
|
||||
<div class="m-4 flex flex-col gap-2">
|
||||
<label class="immich-form-label" for="quotaSize">Quota Size (GiB)</label>
|
||||
<input class="immich-form-input" id="quotaSize" name="quotaSize" type="number" min="0" />
|
||||
<label class="flex items-center gap-2 immich-form-label" for="quotaSize"
|
||||
>Quota Size (GiB) {#if quotaSizeWarning}
|
||||
<p class="text-red-400 text-sm">You set a quota higher than the disk size</p>
|
||||
{/if}</label
|
||||
>
|
||||
<input class="immich-form-input" id="quotaSize" name="quotaSize" type="number" min="0" bind:value={quotaSize} />
|
||||
</div>
|
||||
|
||||
{#if error}
|
||||
|
||||
Reference in New Issue
Block a user