feat(web): automatically update user info (#5647)

* use svelte store

* fix: websocket error when not authenticated

* more routes
This commit is contained in:
martin 2023-12-12 17:35:28 +01:00 committed by GitHub
parent cbca69841a
commit c602eaea4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 114 additions and 155 deletions

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { api, SystemConfigStorageTemplateDto, SystemConfigTemplateStorageOptionDto, UserResponseDto } from '@api';
import { api, SystemConfigStorageTemplateDto, SystemConfigTemplateStorageOptionDto } from '@api';
import * as luxon from 'luxon';
import handlebar from 'handlebars';
import LoadingSpinner from '$lib/components/shared-components/loading-spinner.svelte';
@ -13,9 +13,9 @@
NotificationType,
} from '$lib/components/shared-components/notification/notification';
import SettingInputField, { SettingInputFieldType } from '../setting-input-field.svelte';
import { user } from '$lib/stores/user.store';
export let storageConfig: SystemConfigStorageTemplateDto;
export let user: UserResponseDto;
export let disabled = false;
let savedConfig: SystemConfigStorageTemplateDto;
@ -163,18 +163,18 @@
<p class="text-sm">
Approximately path length limit : <span
class="font-semibold text-immich-primary dark:text-immich-dark-primary"
>{parsedTemplate().length + user.id.length + 'UPLOAD_LOCATION'.length}</span
>{parsedTemplate().length + $user.id.length + 'UPLOAD_LOCATION'.length}</span
>/260
</p>
<p class="text-sm">
<code class="text-immich-primary dark:text-immich-dark-primary">{user.storageLabel || user.id}</code> is the user's
Storage Label
<code class="text-immich-primary dark:text-immich-dark-primary">{$user.storageLabel || $user.id}</code> is the
user's Storage Label
</p>
<p class="p-4 py-2 mt-2 text-xs bg-gray-200 rounded-lg dark:bg-gray-700 dark:text-immich-dark-fg">
<span class="text-immich-fg/25 dark:text-immich-dark-fg/50"
>UPLOAD_LOCATION/{user.storageLabel || user.id}</span
>UPLOAD_LOCATION/{$user.storageLabel || $user.id}</span
>/{parsedTemplate()}.jpg
</p>