2024-01-03 23:28:32 -06:00
|
|
|
<script lang="ts">
|
2025-05-15 18:31:33 -04:00
|
|
|
import AdminSettings from '$lib/components/admin-page/settings/admin-settings.svelte';
|
|
|
|
|
import StorageTemplateSettings from '$lib/components/admin-page/settings/storage-template/storage-template-settings.svelte';
|
|
|
|
|
import FormatMessage from '$lib/components/i18n/format-message.svelte';
|
2024-01-03 23:28:32 -06:00
|
|
|
import { featureFlags } from '$lib/stores/server-config.store';
|
|
|
|
|
import { user } from '$lib/stores/user.store';
|
2024-02-14 06:38:57 -08:00
|
|
|
import { getConfig, type SystemConfigDto } from '@immich/sdk';
|
2024-08-13 19:01:30 +02:00
|
|
|
import { onMount } from 'svelte';
|
2024-11-14 08:43:25 -06:00
|
|
|
|
|
|
|
|
let config: SystemConfigDto | undefined = $state();
|
|
|
|
|
let adminSettingsComponent = $state<ReturnType<typeof AdminSettings>>();
|
2024-01-03 23:28:32 -06:00
|
|
|
|
|
|
|
|
onMount(async () => {
|
2024-02-13 17:07:37 -05:00
|
|
|
config = await getConfig();
|
2024-01-03 23:28:32 -06:00
|
|
|
});
|
2025-06-02 16:09:13 -05:00
|
|
|
|
|
|
|
|
export const save = async () => {
|
|
|
|
|
await adminSettingsComponent?.handleSave({ storageTemplate: config?.storageTemplate });
|
|
|
|
|
};
|
2024-01-03 23:28:32 -06:00
|
|
|
</script>
|
|
|
|
|
|
2025-06-02 16:09:13 -05:00
|
|
|
<div class="flex flex-col">
|
2024-01-03 23:28:32 -06:00
|
|
|
<p>
|
2024-11-14 08:43:25 -06:00
|
|
|
<FormatMessage key="admin.storage_template_onboarding_description">
|
|
|
|
|
{#snippet children({ message })}
|
|
|
|
|
<a class="underline" href="https://immich.app/docs/administration/storage-template">{message}</a>
|
|
|
|
|
{/snippet}
|
2024-06-21 22:08:36 +02:00
|
|
|
</FormatMessage>
|
2024-01-03 23:28:32 -06:00
|
|
|
</p>
|
|
|
|
|
|
2024-01-12 18:44:11 +01:00
|
|
|
{#if config && $user}
|
2024-11-14 08:43:25 -06:00
|
|
|
<AdminSettings bind:config bind:this={adminSettingsComponent}>
|
|
|
|
|
{#snippet children({ defaultConfig, savedConfig })}
|
|
|
|
|
{#if config}
|
|
|
|
|
<StorageTemplateSettings
|
|
|
|
|
minified
|
|
|
|
|
disabled={$featureFlags.configFile}
|
|
|
|
|
{config}
|
|
|
|
|
{defaultConfig}
|
|
|
|
|
{savedConfig}
|
|
|
|
|
onSave={(config) => adminSettingsComponent?.handleSave(config)}
|
|
|
|
|
onReset={(options) => adminSettingsComponent?.handleReset(options)}
|
|
|
|
|
duration={0}
|
2025-06-02 16:09:13 -05:00
|
|
|
/>
|
2024-11-14 08:43:25 -06:00
|
|
|
{/if}
|
|
|
|
|
{/snippet}
|
2024-01-12 18:44:11 +01:00
|
|
|
</AdminSettings>
|
2024-01-03 23:28:32 -06:00
|
|
|
{/if}
|
2025-06-02 16:09:13 -05:00
|
|
|
</div>
|