1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02:00

chore: move library settings cron expression to setting select element (#13856)

This commit is contained in:
Zack Pollard 2024-10-31 15:06:53 +00:00 committed by GitHub
parent 343cdcfeed
commit 16027678ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,7 @@
import SettingButtonsRow from '$lib/components/shared-components/settings/setting-buttons-row.svelte';
import { t } from 'svelte-i18n';
import FormatMessage from '$lib/components/i18n/format-message.svelte';
import SettingSelect from '$lib/components/shared-components/settings/setting-select.svelte';
export let savedConfig: SystemConfigDto;
export let defaultConfig: SystemConfigDto;
@ -21,10 +22,10 @@
export let openByDefault = false;
$: cronExpressionOptions = [
{ title: $t('interval.night_at_midnight'), expression: '0 0 * * *' },
{ title: $t('interval.night_at_twoam'), expression: '0 2 * * *' },
{ title: $t('interval.day_at_onepm'), expression: '0 13 * * *' },
{ title: $t('interval.hours', { values: { hours: 6 } }), expression: '0 */6 * * *' },
{ text: $t('interval.night_at_midnight'), value: '0 0 * * *' },
{ text: $t('interval.night_at_twoam'), value: '0 2 * * *' },
{ text: $t('interval.day_at_onepm'), value: '0 13 * * *' },
{ text: $t('interval.hours', { values: { hours: 6 } }), value: '0 */6 * * *' },
];
</script>
@ -60,25 +61,13 @@
bind:checked={config.library.scan.enabled}
/>
<div class="flex flex-col my-2 dark:text-immich-dark-fg">
<label
class="font-medium text-immich-primary dark:text-immich-dark-primary text-sm"
for="expression-select"
>
{$t('admin.cron_expression_presets')}
</label>
<select
class="p-2 mt-2 text-sm rounded-lg bg-slate-200 hover:cursor-pointer dark:bg-gray-600"
disabled={disabled || !config.library.scan.enabled}
name="expression"
id="expression-select"
bind:value={config.library.scan.cronExpression}
>
{#each cronExpressionOptions as { title, expression }}
<option value={expression}>{title}</option>
{/each}
</select>
</div>
<SettingSelect
options={cronExpressionOptions}
disabled={disabled || !config.library.scan.enabled}
name="expression"
label={$t('admin.cron_expression_presets')}
bind:value={config.library.scan.cronExpression}
/>
<SettingInputField
inputType={SettingInputFieldType.TEXT}