fix: fix RETENTION period setting UI

This commit is contained in:
Ruben Fiszel
2024-01-31 11:02:28 +01:00
parent 4c7c73c3e3
commit ff19d35d42
3 changed files with 10 additions and 3 deletions

View File

@@ -456,7 +456,9 @@
{:else if setting.fieldType == 'seconds'}
<div>
<SecondsInput
disabled={true || (setting.ee_only != undefined && !$enterpriseLicense)}
max={setting.ee_only != undefined && !$enterpriseLicense
? 60 * 60 * 24 * 30
: undefined}
bind:seconds={values[setting.key]}
/>
</div>

View File

@@ -8,6 +8,8 @@
export let seconds = 0
export let hideDisplay = false
export let disabled = false
export let max: number | undefined = undefined
let day: TimeUnit = undefined
let hour: TimeUnit = undefined
let min: TimeUnit = undefined
@@ -38,6 +40,9 @@
(min || 0) * ONE_MINUTE_IN_SECONDS +
(sec || 0)
if (seconds < 0) seconds = 0
if (max && seconds > max) {
seconds = max
}
}
</script>

View File

@@ -78,11 +78,11 @@ export const settings: Record<string, Setting[]> = {
{
label: 'Retention Period in secs',
key: 'retention_period_secs',
description: 'How long to keep the jobs data in the database.',
description: 'How long to keep the jobs data in the database (max 30 days on CE)',
fieldType: 'seconds',
placeholder: '30',
storage: 'setting',
ee_only: 'You can only adjust this setting in the EE version',
ee_only: 'You can only adjust this setting to above 30 days in the EE version',
cloudonly: false
},
{