mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
48 lines
1.6 KiB
Svelte
48 lines
1.6 KiB
Svelte
<script lang="ts">
|
|
import type { SystemConfigDto } from '@immich/sdk';
|
|
import { isEqual } from 'lodash-es';
|
|
import { fade } from 'svelte/transition';
|
|
import type { SettingsResetEvent, SettingsSaveEvent } from '../admin-settings';
|
|
import SettingTextarea from '$lib/components/shared-components/settings/setting-textarea.svelte';
|
|
import SettingButtonsRow from '$lib/components/shared-components/settings/setting-buttons-row.svelte';
|
|
import { t } from 'svelte-i18n';
|
|
|
|
interface Props {
|
|
savedConfig: SystemConfigDto;
|
|
defaultConfig: SystemConfigDto;
|
|
config: SystemConfigDto;
|
|
disabled?: boolean;
|
|
onReset: SettingsResetEvent;
|
|
onSave: SettingsSaveEvent;
|
|
}
|
|
|
|
let { savedConfig, defaultConfig, config = $bindable(), disabled = false, onReset, onSave }: Props = $props();
|
|
|
|
const onsubmit = (event: Event) => {
|
|
event.preventDefault();
|
|
};
|
|
</script>
|
|
|
|
<div>
|
|
<div in:fade={{ duration: 500 }}>
|
|
<form autocomplete="off" {onsubmit}>
|
|
<div class="ml-4 mt-4 flex flex-col gap-4">
|
|
<SettingTextarea
|
|
{disabled}
|
|
label={$t('admin.theme_custom_css_settings')}
|
|
description={$t('admin.theme_custom_css_settings_description')}
|
|
bind:value={config.theme.customCss}
|
|
required={true}
|
|
isEdited={config.theme.customCss !== savedConfig.theme.customCss}
|
|
/>
|
|
|
|
<SettingButtonsRow
|
|
onReset={(options) => onReset({ ...options, configKeys: ['theme'] })}
|
|
onSave={() => onSave({ theme: config.theme })}
|
|
showResetToDefault={!isEqual(savedConfig, defaultConfig)}
|
|
{disabled}
|
|
/>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|