From 0458fee3264c5a8a3fefe69366bed8a4e2e7f71d Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 7 Oct 2025 14:53:44 +0200 Subject: [PATCH] Fix SingleSelect usage for configureRetention --- dashboard/src/components/BackupScheduleDialog.vue | 13 +++++++------ dashboard/src/views/BackupSitesView.vue | 4 ---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/dashboard/src/components/BackupScheduleDialog.vue b/dashboard/src/components/BackupScheduleDialog.vue index af0ce8d97..ed9d07881 100644 --- a/dashboard/src/components/BackupScheduleDialog.vue +++ b/dashboard/src/components/BackupScheduleDialog.vue @@ -16,7 +16,7 @@ const dialog = useTemplateRef('dialog'); const scheduleEnabled = ref(false); const days = ref([]); const hours = ref([]); -const configureRetention = ref(''); +const configureRetention = ref(''); // this is 'name' and not 'id' of backupRetentions because SingleSelect needs strings const isConfigureValid = computed(() => { return !!days.value.length && !!hours.value.length; }); @@ -48,7 +48,8 @@ async function onSubmit() { return console.error(error); } - [error] = await backupSitesModel.setRetention(id.value, configureRetention.value); + const selectedRetention = BackupSitesModel.backupRetentions.find(function (x) { return x.name === configureRetention.value; }); + [error] = await backupSitesModel.setRetention(id.value, selectedRetention.id); if (error) { busy.value = false; formError.value = error.body ? error.body.message : 'Internal error'; @@ -68,9 +69,8 @@ defineExpose({ formError.value = false; const currentRetentionString = JSON.stringify(site.retention); - let selectedRetention = BackupSitesModel.backupRetentions.find(function (x) { return JSON.stringify(x.id) === currentRetentionString; }); - if (!selectedRetention) selectedRetention = BackupSitesModel.backupRetentions[0]; - configureRetention.value = selectedRetention.id; + const selectedRetention = BackupSitesModel.backupRetentions.find(function (x) { return JSON.stringify(x.id) === currentRetentionString; }); + configureRetention.value = selectedRetention ? selectedRetention.name : BackupSitesModel.backupRetentions[0].name; if (site.schedule === 'never') { scheduleEnabled.value = false; @@ -122,7 +122,8 @@ defineExpose({ - + + diff --git a/dashboard/src/views/BackupSitesView.vue b/dashboard/src/views/BackupSitesView.vue index a1cad5e6b..d8cf4ec36 100644 --- a/dashboard/src/views/BackupSitesView.vue +++ b/dashboard/src/views/BackupSitesView.vue @@ -318,10 +318,6 @@ onMounted(async () => { justify-content: space-between; } -.backup-site:hover { - /*background-color: var(--pankow-color-background-hover);*/ -} - .backup-site-details { display: flex; flex-direction: column;