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';
|
2024-01-20 13:47:41 -05:00
|
|
|
import { createEventDispatcher } from 'svelte';
|
2023-10-23 11:38:41 -07:00
|
|
|
import { fade } from 'svelte/transition';
|
2024-01-20 13:47:41 -05:00
|
|
|
import type { SettingsEventType } 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';
|
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-01-12 18:44:11 +01:00
|
|
|
const dispatch = createEventDispatcher<SettingsEventType>();
|
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}
|
|
|
|
|
label="Custom CSS"
|
|
|
|
|
desc="Cascading Style Sheets allow the design of Immich to be customized."
|
|
|
|
|
bind:value={config.theme.customCss}
|
|
|
|
|
required={true}
|
|
|
|
|
isEdited={config.theme.customCss !== savedConfig.theme.customCss}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<SettingButtonsRow
|
|
|
|
|
on:reset={({ detail }) => dispatch('reset', { ...detail, configKeys: ['theme'] })}
|
|
|
|
|
on:save={() => dispatch('save', { theme: config.theme })}
|
|
|
|
|
showResetToDefault={!isEqual(savedConfig, defaultConfig)}
|
|
|
|
|
{disabled}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
2023-10-23 11:38:41 -07:00
|
|
|
</div>
|