Remove primary backup site UI
This commit is contained in:
@@ -42,26 +42,6 @@ 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'),
|
||||
@@ -140,10 +120,6 @@ 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'),
|
||||
@@ -153,7 +129,6 @@ function onActionMenu(site, event) {
|
||||
}, {
|
||||
icon: 'fa-solid fa-trash',
|
||||
label: t('volumes.removeVolumeDialog.removeAction'),
|
||||
disabled: site.primary,
|
||||
action: onRemoveSite.bind(null, site),
|
||||
}];
|
||||
|
||||
@@ -225,7 +200,6 @@ onMounted(async () => {
|
||||
<div class="content">
|
||||
<Menu ref="actionMenuElement" :model="actionMenuModel" />
|
||||
<InputDialog ref="inputDialog" />
|
||||
<InputDialog ref="backupPrimaryDialog" />
|
||||
<BackupSiteAddDialog ref="backupSiteAddDialog" @success="refresh()"/>
|
||||
<BackupSiteEditDialog ref="backupSiteEditDialog" @success="refresh()"/>
|
||||
<BackupScheduleDialog ref="backupScheduleDialog" @success="refresh()"/>
|
||||
@@ -242,7 +216,7 @@ onMounted(async () => {
|
||||
<StateLED :busy="site.status.busy" :state="site.status.state"/>
|
||||
</div>
|
||||
<div class="backup-site-details">
|
||||
<div><b style="font-size: 16px">{{ site.name }}</b><i v-if="site.primary" style="padding-left: 5px" class="fa-solid fa-star"></i></div>
|
||||
<div><b style="font-size: 16px">{{ site.name }}</b></div>
|
||||
<div>
|
||||
{{ $t('backups.configureBackupStorage.provider') }}: <b>{{ site.provider }}</b> - {{ $t('backups.configureBackupStorage.format') }}: <b>{{ site.format }}</b> <i v-if="site.encrypted" class="fa-solid fa-lock"></i></div>
|
||||
<div class="backup-site-task">
|
||||
|
||||
Reference in New Issue
Block a user