2024-08-13 19:01:30 +02:00
|
|
|
<script lang="ts">
|
2025-05-15 18:31:33 -04:00
|
|
|
import AdminSettings from '$lib/components/admin-page/settings/admin-settings.svelte';
|
|
|
|
|
import SettingSwitch from '$lib/components/shared-components/settings/setting-switch.svelte';
|
2024-08-13 19:01:30 +02:00
|
|
|
import { user } from '$lib/stores/user.store';
|
|
|
|
|
import { getConfig, type SystemConfigDto } from '@immich/sdk';
|
2025-05-15 18:31:33 -04:00
|
|
|
import { Button } from '@immich/ui';
|
2024-08-13 19:01:30 +02:00
|
|
|
import { mdiArrowLeft, mdiArrowRight, mdiIncognito } from '@mdi/js';
|
|
|
|
|
import { onMount } from 'svelte';
|
|
|
|
|
import { t } from 'svelte-i18n';
|
2025-05-15 18:31:33 -04:00
|
|
|
import OnboardingCard from './onboarding-card.svelte';
|
2024-08-13 19:01:30 +02:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
interface Props {
|
|
|
|
|
onDone: () => void;
|
|
|
|
|
onPrevious: () => void;
|
|
|
|
|
}
|
2024-08-13 19:01:30 +02:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
let { onDone, onPrevious }: Props = $props();
|
|
|
|
|
|
|
|
|
|
let config: SystemConfigDto | null = $state(null);
|
|
|
|
|
let adminSettingsComponent = $state<ReturnType<typeof AdminSettings>>();
|
2024-08-13 19:01:30 +02:00
|
|
|
|
|
|
|
|
onMount(async () => {
|
|
|
|
|
config = await getConfig();
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<OnboardingCard title={$t('privacy')} icon={mdiIncognito}>
|
|
|
|
|
<p>
|
|
|
|
|
{$t('onboarding_privacy_description')}
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
{#if config && $user}
|
2024-11-14 08:43:25 -06:00
|
|
|
<AdminSettings bind:config bind:this={adminSettingsComponent}>
|
2025-03-03 14:24:26 +00:00
|
|
|
{#if config}
|
|
|
|
|
<SettingSwitch
|
|
|
|
|
title={$t('admin.map_settings')}
|
|
|
|
|
subtitle={$t('admin.map_implications')}
|
|
|
|
|
bind:checked={config.map.enabled}
|
|
|
|
|
/>
|
|
|
|
|
<SettingSwitch
|
|
|
|
|
title={$t('admin.version_check_settings')}
|
|
|
|
|
subtitle={$t('admin.version_check_implications')}
|
|
|
|
|
bind:checked={config.newVersionCheck.enabled}
|
|
|
|
|
/>
|
|
|
|
|
<div class="flex pt-4">
|
|
|
|
|
<div class="w-full flex place-content-start">
|
2025-05-15 18:31:33 -04:00
|
|
|
<Button
|
|
|
|
|
shape="round"
|
|
|
|
|
leadingIcon={mdiArrowLeft}
|
|
|
|
|
class="flex gap-2 place-content-center"
|
|
|
|
|
onclick={() => onPrevious()}
|
|
|
|
|
>
|
2025-03-03 14:24:26 +00:00
|
|
|
<p>{$t('theme')}</p>
|
|
|
|
|
</Button>
|
2024-11-14 08:43:25 -06:00
|
|
|
</div>
|
2025-03-03 14:24:26 +00:00
|
|
|
<div class="flex w-full place-content-end">
|
|
|
|
|
<Button
|
2025-05-15 18:31:33 -04:00
|
|
|
shape="round"
|
|
|
|
|
trailingIcon={mdiArrowRight}
|
2025-03-03 14:24:26 +00:00
|
|
|
onclick={() => {
|
|
|
|
|
adminSettingsComponent?.handleSave({ map: config?.map, newVersionCheck: config?.newVersionCheck });
|
|
|
|
|
onDone();
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<span class="flex place-content-center place-items-center gap-2">
|
|
|
|
|
{$t('admin.storage_template_settings')}
|
|
|
|
|
</span>
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
2024-08-13 19:01:30 +02:00
|
|
|
</AdminSettings>
|
|
|
|
|
{/if}
|
|
|
|
|
</OnboardingCard>
|