diff --git a/dashboard/public/translation/en.json b/dashboard/public/translation/en.json index 47dc1d017..ead7d61a0 100644 --- a/dashboard/public/translation/en.json +++ b/dashboard/public/translation/en.json @@ -566,7 +566,8 @@ "backupNow": "Backup now", "stopTask": "Stop Backup", "tooltipEditBackup": "Edit Backup", - "tooltipPreservedBackup": "This backup will be preserved" + "tooltipPreservedBackup": "This backup will be preserved", + "primaryAction": "Set as Primary" }, "logs": { "title": "Logs", @@ -2092,9 +2093,9 @@ "sites": { "title": "Backup Sites" }, - "updateSite": { - "title": "Backup Site for Updates", - "description": "Choose the backup site to use before automatic updates" + "primaryDialog": { + "title": "Set as Primary Site", + "description": "The Primary Site is used for automatic updates." } }, "dockerRegistries": { diff --git a/dashboard/public/translation/nl.json b/dashboard/public/translation/nl.json index 990dda36e..00d2036f1 100644 --- a/dashboard/public/translation/nl.json +++ b/dashboard/public/translation/nl.json @@ -548,7 +548,7 @@ "remount": "Her-koppel Storage" }, "schedule": { - "title": "Planning en bewaartermijn", + "title": "Planning & Bewaartermijn", "schedule": "Planning", "retentionPolicy": "Bewaartermijn", "configure": "Configureer", @@ -686,10 +686,13 @@ "addDialog": { "title": "Voeg Backup Opslag toe" } + }, + "sites": { + "title": "Locaties" } }, "branding": { - "title": "Uiterlijk", + "title": "Huisstijl", "cloudronName": "Naam van deze Cloudron", "logo": "Logo", "footer": { @@ -767,7 +770,7 @@ "manualInfo": "Stel handmatig A (IPv4) and AAAA (IPv6) DNS records in voor {{ domain }} die verwijzen naar deze Cloudron", "locationPlaceholder": "Leeg laten om hoofddomein te gebruiken", "title": "E-mail server locatie aanpassen", - "description": "Dit verhuist de IMAP en SMTP server naar de aangegeven lokatie." + "description": "Dit verhuist de IMAP en SMTP server naar de aangegeven locatie." }, "changeMailSizeDialog": { "title": "Maximale e-mail grootte aanpassen", @@ -1261,10 +1264,10 @@ "sftpInfoAction": "SFTP Toegang", "cronTabTitle": "Cron", "addApplinkDialog": { - "title": "Voeg externe app link toe" + "title": "Voeg Externe Link toe" }, "editApplinkDialog": { - "title": "Bewerk App Link", + "title": "Bewerk Externe Link", "deleteAction": "Verwijder" }, "applinks": { @@ -2075,7 +2078,7 @@ }, "archives": { "listing": { - "placeholder": "Geen app archieven" + "placeholder": "Geen gearchiveerde apps" } }, "backup": { @@ -2085,6 +2088,9 @@ "description": "Dit zal ook alle backups gekoppeld aan dit doel verwijderen" }, "label": "Opslag" + }, + "sites": { + "title": "Backup Locaties" } }, "dockerRegistries": { @@ -2109,5 +2115,15 @@ }, "userDirectory": { "title": "Gebruikersadresboek" + }, + "appearance": { + "title": "Weergave" + }, + "dashboard": { + "title": "Dashboard" + }, + "externallinks": { + "label": "Externe Links", + "description": "Voeg snelkoppeling toe op het dashboard naar externe diensten" } } diff --git a/dashboard/src/Index.vue b/dashboard/src/Index.vue index d9e43e2bb..50419e944 100644 --- a/dashboard/src/Index.vue +++ b/dashboard/src/Index.vue @@ -286,8 +286,8 @@ onMounted(async () => { diff --git a/dashboard/src/views/BackupSitesView.vue b/dashboard/src/views/BackupSitesView.vue index c3ea6c9c7..97e6a1786 100644 --- a/dashboard/src/views/BackupSitesView.vue +++ b/dashboard/src/views/BackupSitesView.vue @@ -5,10 +5,9 @@ const i18n = useI18n(); const t = i18n.t; import { ref, onMounted, useTemplateRef } from 'vue'; -import { Button, Menu, ProgressBar, InputDialog, SingleSelect } from '@cloudron/pankow'; +import { Button, Menu, ProgressBar, InputDialog } from '@cloudron/pankow'; import { prettyLongDate } from '@cloudron/pankow/utils'; import Section from '../components/Section.vue'; -import SettingsItem from '../components/SettingsItem.vue'; import StateLED from '../components/StateLED.vue'; import BackupScheduleDialog from '../components/BackupScheduleDialog.vue'; import BackupSiteAddDialog from '../components/BackupSiteAddDialog.vue'; @@ -43,6 +42,26 @@ function onEditSchedule(site) { backupScheduleDialog.value.open(site); } +const backupPrimaryDialog = useTemplateRef('backupPrimaryDialog'); +async function onPrimary(site) { + const yes = await backupPrimaryDialog.value.confirm({ + title: t('backup.primaryDialog.title'), + message: t('backup.primaryDialog.description'), + confirmLabel: t('main.dialog.yes'), + confirmStyle: 'primary', + rejectLabel: t('main.dialog.cancel'), + rejectStyle: 'secondary', + }); + + if (!yes) return; + + const [error] = await backupSitesModels.setPrimary(site.id); + if (error) return console.error(error); + + // update the list to be in sync without flickering + sites.value.forEach(t => t.primary = t.id === site.id); +} + async function onRemoveSite(site) { const yes = await inputDialog.value.confirm({ title: t('backup.target.removeDialog.title'), @@ -113,6 +132,10 @@ function onActionMenu(site, event) { icon: 'fa-solid fa-pencil-alt', label: t('main.dialog.edit'), action: onEdit.bind(null, site), + }, { + icon: 'fa-solid fa-star', + label: t('backups.listing.primaryAction'), + action: onPrimary.bind(null, site), }, { icon: 'fa-solid fa-clock', label: t('backups.schedule.title'), @@ -129,22 +152,6 @@ function onActionMenu(site, event) { actionMenuElement.value.open(event, event.currentTarget); } -const primarySiteId = ref(''); -const primarySiteChangeBusy = ref(false); - -async function onPrimarySiteChanged(value) { - primarySiteChangeBusy.value = true; - - const [error] = await backupSitesModels.setPrimary(value); - if (error) return console.error(error); - - // update the list to be in sync without flickering - sites.value.forEach(t => t.primary = t.id === value); - - primarySiteId.value = value; - primarySiteChangeBusy.value = false; -} - async function waitForSiteTask(site) { const [error, result] = await tasksModel.get(site.task.id); if (error) { @@ -189,8 +196,6 @@ async function refresh() { if (site.task && site.task.active) waitForSiteTask(site); } - primarySiteId.value = result.find(t => t.primary)?.id; - sites.value = result; busy.value = false; } @@ -210,6 +215,7 @@ onMounted(async () => {
+ @@ -225,7 +231,7 @@ onMounted(async () => {
-
{{ site.name }} - used for updates
+
{{ site.name }}
{{ $t('backups.configureBackupStorage.provider') }}: {{ site.provider }} - {{ $t('backups.configureBackupStorage.format') }}: {{ site.format }}
@@ -243,17 +249,6 @@ onMounted(async () => {
- -
- -
-
{{ $t('backup.updateSite.description') }}
-
-
- -
-
-