2023-10-23 11:38:41 -07:00
|
|
|
<script lang="ts">
|
2024-02-14 08:09:49 -05:00
|
|
|
import type { SystemConfigDto } from '@immich/sdk';
|
2023-10-23 11:38:41 -07:00
|
|
|
import { isEqual } from 'lodash-es';
|
|
|
|
|
import { fade } from 'svelte/transition';
|
2024-07-10 15:57:18 +02:00
|
|
|
import type { SettingsResetEvent, SettingsSaveEvent } from '../admin-settings';
|
2024-02-22 15:36:14 +01:00
|
|
|
import SettingTextarea from '$lib/components/shared-components/settings/setting-textarea.svelte';
|
|
|
|
|
import SettingButtonsRow from '$lib/components/shared-components/settings/setting-buttons-row.svelte';
|
2024-06-04 21:53:00 +02:00
|
|
|
import { t } from 'svelte-i18n';
|
2023-10-23 11:38:41 -07:00
|
|
|
|
2024-01-12 18:44:11 +01:00
|
|
|
export let savedConfig: SystemConfigDto;
|
|
|
|
|
export let defaultConfig: SystemConfigDto;
|
|
|
|
|
export let config: SystemConfigDto; // this is the config that is being edited
|
2023-10-23 11:38:41 -07:00
|
|
|
export let disabled = false;
|
2024-07-10 15:57:18 +02:00
|
|
|
export let onReset: SettingsResetEvent;
|
|
|
|
|
export let onSave: SettingsSaveEvent;
|
2023-10-23 11:38:41 -07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div>
|
2024-01-12 18:44:11 +01:00
|
|
|
<div in:fade={{ duration: 500 }}>
|
|
|
|
|
<form autocomplete="off" on:submit|preventDefault>
|
|
|
|
|
<div class="ml-4 mt-4 flex flex-col gap-4">
|
|
|
|
|
<SettingTextarea
|
|
|
|
|
{disabled}
|
2024-06-04 21:53:00 +02:00
|
|
|
label={$t('admin.theme_custom_css_settings')}
|
|
|
|
|
desc={$t('admin.theme_custom_css_settings_description')}
|
2024-01-12 18:44:11 +01:00
|
|
|
bind:value={config.theme.customCss}
|
|
|
|
|
required={true}
|
|
|
|
|
isEdited={config.theme.customCss !== savedConfig.theme.customCss}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<SettingButtonsRow
|
2024-07-10 15:57:18 +02:00
|
|
|
onReset={(options) => onReset({ ...options, configKeys: ['theme'] })}
|
|
|
|
|
onSave={() => onSave({ theme: config.theme })}
|
2024-01-12 18:44:11 +01:00
|
|
|
showResetToDefault={!isEqual(savedConfig, defaultConfig)}
|
|
|
|
|
{disabled}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
2023-10-23 11:38:41 -07:00
|
|
|
</div>
|