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-11-14 08:43:25 -06:00
|
|
|
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();
|
|
|
|
|
};
|
2023-10-23 11:38:41 -07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<div>
|
2024-01-12 18:44:11 +01:00
|
|
|
<div in:fade={{ duration: 500 }}>
|
2024-11-14 08:43:25 -06:00
|
|
|
<form autocomplete="off" {onsubmit}>
|
2024-01-12 18:44:11 +01:00
|
|
|
<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')}
|
2024-11-14 08:43:25 -06:00
|
|
|
description={$t('admin.theme_custom_css_settings_description')}
|
2024-01-12 18:44:11 +01:00
|
|
|
bind:value={config.theme.customCss}
|
|
|
|
|
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>
|