mirror of
https://github.com/immich-app/immich.git
synced 2025-01-07 00:50:23 -05:00
chore: move library settings cron expression to setting select element (#13856)
This commit is contained in:
parent
343cdcfeed
commit
16027678ee
1 changed files with 12 additions and 23 deletions
|
@ -11,6 +11,7 @@
|
||||||
import SettingButtonsRow from '$lib/components/shared-components/settings/setting-buttons-row.svelte';
|
import SettingButtonsRow from '$lib/components/shared-components/settings/setting-buttons-row.svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
import FormatMessage from '$lib/components/i18n/format-message.svelte';
|
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 savedConfig: SystemConfigDto;
|
||||||
export let defaultConfig: SystemConfigDto;
|
export let defaultConfig: SystemConfigDto;
|
||||||
|
@ -21,10 +22,10 @@
|
||||||
export let openByDefault = false;
|
export let openByDefault = false;
|
||||||
|
|
||||||
$: cronExpressionOptions = [
|
$: cronExpressionOptions = [
|
||||||
{ title: $t('interval.night_at_midnight'), expression: '0 0 * * *' },
|
{ text: $t('interval.night_at_midnight'), value: '0 0 * * *' },
|
||||||
{ title: $t('interval.night_at_twoam'), expression: '0 2 * * *' },
|
{ text: $t('interval.night_at_twoam'), value: '0 2 * * *' },
|
||||||
{ title: $t('interval.day_at_onepm'), expression: '0 13 * * *' },
|
{ text: $t('interval.day_at_onepm'), value: '0 13 * * *' },
|
||||||
{ title: $t('interval.hours', { values: { hours: 6 } }), expression: '0 */6 * * *' },
|
{ text: $t('interval.hours', { values: { hours: 6 } }), value: '0 */6 * * *' },
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -60,25 +61,13 @@
|
||||||
bind:checked={config.library.scan.enabled}
|
bind:checked={config.library.scan.enabled}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="flex flex-col my-2 dark:text-immich-dark-fg">
|
<SettingSelect
|
||||||
<label
|
options={cronExpressionOptions}
|
||||||
class="font-medium text-immich-primary dark:text-immich-dark-primary text-sm"
|
disabled={disabled || !config.library.scan.enabled}
|
||||||
for="expression-select"
|
name="expression"
|
||||||
>
|
label={$t('admin.cron_expression_presets')}
|
||||||
{$t('admin.cron_expression_presets')}
|
bind:value={config.library.scan.cronExpression}
|
||||||
</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>
|
|
||||||
|
|
||||||
<SettingInputField
|
<SettingInputField
|
||||||
inputType={SettingInputFieldType.TEXT}
|
inputType={SettingInputFieldType.TEXT}
|
||||||
|
|
Loading…
Reference in a new issue