2023-10-24 17:05:42 +02:00
|
|
|
<script lang="ts">
|
2024-02-14 08:09:49 -05:00
|
|
|
import type { SystemConfigDto } from '@immich/sdk';
|
2023-10-24 17:05:42 +02:00
|
|
|
import { isEqual } from 'lodash-es';
|
2024-01-20 13:47:41 -05:00
|
|
|
import { createEventDispatcher } from 'svelte';
|
2023-10-24 17:05:42 +02: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 SettingButtonsRow from '$lib/components/shared-components/settings/setting-buttons-row.svelte';
|
|
|
|
|
import SettingSwitch from '$lib/components/shared-components/settings/setting-switch.svelte';
|
2023-10-24 17:05:42 +02: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-12-16 20:39:17 +01:00
|
|
|
export let disabled = false;
|
2023-10-24 17:05:42 +02:00
|
|
|
|
2024-01-12 18:44:11 +01:00
|
|
|
const dispatch = createEventDispatcher<SettingsEventType>();
|
2023-10-24 17:05:42 +02: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">
|
|
|
|
|
<SettingSwitch
|
2024-04-06 14:18:49 +00:00
|
|
|
id="enable-new-version-check"
|
2024-01-12 18:44:11 +01:00
|
|
|
title="ENABLED"
|
2024-03-24 22:35:06 -05:00
|
|
|
subtitle="Enable periodic requests to GitHub to check for new releases"
|
2024-01-12 18:44:11 +01:00
|
|
|
bind:checked={config.newVersionCheck.enabled}
|
|
|
|
|
{disabled}
|
|
|
|
|
/>
|
|
|
|
|
<SettingButtonsRow
|
|
|
|
|
on:reset={({ detail }) => dispatch('reset', { ...detail, configKeys: ['newVersionCheck'] })}
|
|
|
|
|
on:save={() => dispatch('save', { newVersionCheck: config.newVersionCheck })}
|
|
|
|
|
showResetToDefault={!isEqual(savedConfig, defaultConfig)}
|
|
|
|
|
{disabled}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
2023-10-24 17:05:42 +02:00
|
|
|
</div>
|