mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:29:32 -05:00 
			
		
		
		
	Fixed webp upload on web (#460)
This commit is contained in:
		
							parent
							
								
									4b34f017ca
								
							
						
					
					
						commit
						a388c5a642
					
				@ -63,7 +63,7 @@ async function fileUploader(asset: File, uploadType: UploadType) {
 | 
				
			|||||||
		let exifData = null;
 | 
							let exifData = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (assetType !== 'VIDEO') {
 | 
							if (assetType !== 'VIDEO') {
 | 
				
			||||||
			exifData = await exifr.parse(asset);
 | 
								exifData = await exifr.parse(asset).catch((e) => console.log('error parsing exif', e));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		const createdAt =
 | 
							const createdAt =
 | 
				
			||||||
 | 
				
			|||||||
@ -12,8 +12,12 @@
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
      const user: UserResponseDto = await fetch('/data/user/get-my-user-info').then((r) => r.json());
 | 
								const user: UserResponseDto = await fetch('/data/user/get-my-user-info').then((r) =>
 | 
				
			||||||
      const allUsers: UserResponseDto[] = await fetch('/data/user/get-all-users?isAll=false').then((r) => r.json());
 | 
									r.json()
 | 
				
			||||||
 | 
								);
 | 
				
			||||||
 | 
								const allUsers: UserResponseDto[] = await fetch('/data/user/get-all-users?isAll=false').then(
 | 
				
			||||||
 | 
									(r) => r.json()
 | 
				
			||||||
 | 
								);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			if (!user.isAdmin) {
 | 
								if (!user.isAdmin) {
 | 
				
			||||||
				return {
 | 
									return {
 | 
				
			||||||
@ -51,7 +55,6 @@
 | 
				
			|||||||
	import EditUserForm from '$lib/components/forms/edit-user-form.svelte';
 | 
						import EditUserForm from '$lib/components/forms/edit-user-form.svelte';
 | 
				
			||||||
	import StatusBox from '$lib/components/shared-components/status-box.svelte';
 | 
						import StatusBox from '$lib/components/shared-components/status-box.svelte';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
	let selectedAction: AdminSideBarSelection = AdminSideBarSelection.USER_MANAGEMENT;
 | 
						let selectedAction: AdminSideBarSelection = AdminSideBarSelection.USER_MANAGEMENT;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	export let user: UserResponseDto;
 | 
						export let user: UserResponseDto;
 | 
				
			||||||
@ -87,14 +90,14 @@
 | 
				
			|||||||
		const { data } = await api.userApi.getAllUsers(false);
 | 
							const { data } = await api.userApi.getAllUsers(false);
 | 
				
			||||||
		allUsers = data;
 | 
							allUsers = data;
 | 
				
			||||||
		shouldShowEditUserForm = false;
 | 
							shouldShowEditUserForm = false;
 | 
				
			||||||
  }
 | 
						};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	const onEditPasswordSuccess = async () => {
 | 
						const onEditPasswordSuccess = async () => {
 | 
				
			||||||
		const { data } = await api.userApi.getAllUsers(false);
 | 
							const { data } = await api.userApi.getAllUsers(false);
 | 
				
			||||||
		allUsers = data;
 | 
							allUsers = data;
 | 
				
			||||||
		shouldShowEditUserForm = false;
 | 
							shouldShowEditUserForm = false;
 | 
				
			||||||
		shouldShowInfoPanel = true;
 | 
							shouldShowInfoPanel = true;
 | 
				
			||||||
  }
 | 
						};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<svelte:head>
 | 
					<svelte:head>
 | 
				
			||||||
@ -111,37 +114,38 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
{#if shouldShowEditUserForm}
 | 
					{#if shouldShowEditUserForm}
 | 
				
			||||||
	<FullScreenModal on:clickOutside={() => (shouldShowEditUserForm = false)}>
 | 
						<FullScreenModal on:clickOutside={() => (shouldShowEditUserForm = false)}>
 | 
				
			||||||
        <EditUserForm user={editUser} on:edit-success={onEditUserSuccess}
 | 
							<EditUserForm
 | 
				
			||||||
                      on:reset-password-success={onEditPasswordSuccess}/>
 | 
								user={editUser}
 | 
				
			||||||
 | 
								on:edit-success={onEditUserSuccess}
 | 
				
			||||||
 | 
								on:reset-password-success={onEditPasswordSuccess}
 | 
				
			||||||
 | 
							/>
 | 
				
			||||||
	</FullScreenModal>
 | 
						</FullScreenModal>
 | 
				
			||||||
{/if}
 | 
					{/if}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{#if shouldShowInfoPanel}
 | 
					{#if shouldShowInfoPanel}
 | 
				
			||||||
	<FullScreenModal on:clickOutside={() => (shouldShowInfoPanel = false)}>
 | 
						<FullScreenModal on:clickOutside={() => (shouldShowInfoPanel = false)}>
 | 
				
			||||||
 | 
					 | 
				
			||||||
		<div class="border bg-white shadow-sm w-[500px] rounded-3xl p-8 text-sm">
 | 
							<div class="border bg-white shadow-sm w-[500px] rounded-3xl p-8 text-sm">
 | 
				
			||||||
			<h1 class="font-bold text-immich-primary text-lg mb-4">Password reset success</h1>
 | 
								<h1 class="font-bold text-immich-primary text-lg mb-4">Password reset success</h1>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<p>
 | 
								<p>
 | 
				
			||||||
				The user's password has been reset to the default <code
 | 
									The user's password has been reset to the default <code
 | 
				
			||||||
                    class="font-bold bg-gray-200 px-2 py-1 rounded-md text-immich-primary">password</code>
 | 
										class="font-bold bg-gray-200 px-2 py-1 rounded-md text-immich-primary">password</code
 | 
				
			||||||
                <br>
 | 
									>
 | 
				
			||||||
 | 
									<br />
 | 
				
			||||||
				Please inform the user, and they will need to change the password at the next log-on.
 | 
									Please inform the user, and they will need to change the password at the next log-on.
 | 
				
			||||||
			</p>
 | 
								</p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<div class="flex w-full">
 | 
								<div class="flex w-full">
 | 
				
			||||||
				<button
 | 
									<button
 | 
				
			||||||
                        on:click={() => shouldShowInfoPanel = false}
 | 
										on:click={() => (shouldShowInfoPanel = false)}
 | 
				
			||||||
					class="mt-6 bg-immich-primary hover:bg-immich-primary/75 px-6 py-3 text-white rounded-full shadow-md w-full font-medium"
 | 
										class="mt-6 bg-immich-primary hover:bg-immich-primary/75 px-6 py-3 text-white rounded-full shadow-md w-full font-medium"
 | 
				
			||||||
					>Done
 | 
										>Done
 | 
				
			||||||
                </button
 | 
									</button>
 | 
				
			||||||
                >
 | 
					 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
	</FullScreenModal>
 | 
						</FullScreenModal>
 | 
				
			||||||
{/if}
 | 
					{/if}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
<section class="grid grid-cols-[250px_auto] relative pt-[72px] h-screen">
 | 
					<section class="grid grid-cols-[250px_auto] relative pt-[72px] h-screen">
 | 
				
			||||||
	<section id="admin-sidebar" class="pt-8 pr-6 flex flex-col">
 | 
						<section id="admin-sidebar" class="pt-8 pr-6 flex flex-col">
 | 
				
			||||||
		<SideBarButton
 | 
							<SideBarButton
 | 
				
			||||||
@ -162,7 +166,6 @@
 | 
				
			|||||||
			<hr />
 | 
								<hr />
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
		<section id="setting-content" class="relative pt-[85px] flex place-content-center">
 | 
							<section id="setting-content" class="relative pt-[85px] flex place-content-center">
 | 
				
			||||||
			<section class="w-[800px] pt-4">
 | 
								<section class="w-[800px] pt-4">
 | 
				
			||||||
				{#if selectedAction === AdminSideBarSelection.USER_MANAGEMENT}
 | 
									{#if selectedAction === AdminSideBarSelection.USER_MANAGEMENT}
 | 
				
			||||||
@ -175,5 +178,4 @@
 | 
				
			|||||||
			</section>
 | 
								</section>
 | 
				
			||||||
		</section>
 | 
							</section>
 | 
				
			||||||
	</section>
 | 
						</section>
 | 
				
			||||||
 | 
					 | 
				
			||||||
</section>
 | 
					</section>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user