Remove cleanup from backup listing
This commit is contained in:
@@ -80,12 +80,8 @@ const trackingBackupTask = ref({});
|
||||
const trackingCleanupTask = ref({});
|
||||
const sites = ref([]);
|
||||
const backupBusy = ref(false);
|
||||
const startCleanupError = ref('');
|
||||
const startCleanupBusy = ref(false);
|
||||
const sitesMenu = ref([]);
|
||||
|
||||
let primarySiteId = null;
|
||||
|
||||
async function waitForBackupTask(id) {
|
||||
if (!id || (trackingBackupTask.value.id && trackingBackupTask.value.id !== id)) return;
|
||||
|
||||
@@ -218,39 +214,6 @@ async function onBackup(siteId) {
|
||||
window.location.href = '/#/backup-sites';
|
||||
}
|
||||
|
||||
async function onStartCleanup() {
|
||||
startCleanupBusy.value = true;
|
||||
startCleanupError.value = '';
|
||||
|
||||
const [error] = await backupSitesModel.cleanup(primarySiteId);
|
||||
if (error) {
|
||||
if (error.status === 409) {
|
||||
if (error.body.message.indexOf('full_backup') !== -1) startCleanupError.value = 'Cleanup already in progress. Please retry later.';
|
||||
else startCleanupError.value = 'App task is currently in progress. Please retry later.';
|
||||
}
|
||||
|
||||
startCleanupBusy.value = false;
|
||||
return console.error(error);
|
||||
}
|
||||
|
||||
await refreshTasks();
|
||||
|
||||
startCleanupBusy.value = false;
|
||||
}
|
||||
|
||||
const stopCleanupBusy = ref(false);
|
||||
|
||||
async function onStopCleanup() {
|
||||
stopCleanupBusy.value = true;
|
||||
|
||||
const [error] = await tasksModel.stop(trackingCleanupTask.value.id);
|
||||
if (error) return console.error(error);
|
||||
|
||||
await refreshTasks();
|
||||
|
||||
stopCleanupBusy.value = false;
|
||||
}
|
||||
|
||||
async function onDownloadConfig(backup) {
|
||||
const [error, dashboardConfig] = await dashboardModel.config();
|
||||
if (error) return console.error(error);
|
||||
@@ -320,11 +283,6 @@ onMounted(async () => {
|
||||
};
|
||||
});
|
||||
|
||||
const primarySite = result.find(t => t.primary);
|
||||
if (!primarySite) return;
|
||||
|
||||
primarySiteId = primarySite.id;
|
||||
|
||||
await refreshBackups();
|
||||
await refreshTasks();
|
||||
busy.value = false;
|
||||
@@ -405,21 +363,6 @@ onMounted(async () => {
|
||||
<Button tool secondary :menu="taskLogsMenu" :disabled="!taskLogsMenu.length">{{ $t('main.action.logs') }}</Button>
|
||||
</template>
|
||||
|
||||
<SettingsItem>
|
||||
<div style="flex-grow: 1; max-width: unset;">
|
||||
<div v-html="$t('backups.cleanupBackups.description')"></div>
|
||||
<div v-if="trackingCleanupTask.active" style="margin-top: 10px;">
|
||||
<ProgressBar :value="trackingCleanupTask.percent" :busy="true" />
|
||||
<div>{{ trackingCleanupTask.message }}</div>
|
||||
</div>
|
||||
<div class="error-label" v-if="startCleanupError">{{ startCleanupError }}</div>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center">
|
||||
<Button danger @click="onStopCleanup()" v-if="trackingCleanupTask.active" :loading="stopCleanupBusy" :disabled="stopCleanupBusy">{{ $t('backups.listing.stopTask') }}</Button>
|
||||
<Button plain @click="onStartCleanup()" v-else :loading="startCleanupBusy || trackingCleanupTask.active" :disabled="backupBusy || trackingCleanupTask.active">{{ $t('backups.cleanupBackups.cleanupNow') }}</Button>
|
||||
</div>
|
||||
</SettingsItem>
|
||||
|
||||
<TableView :columns="columns" :model="backups" :busy="busy" style="margin-top: 30px;" :placeholder="$t('backups.listing.noBackups')">
|
||||
<template #preserveSecs="backup">
|
||||
<i class="fas fa-archive" v-show="backup.preserveSecs === -1" v-tooltip="$t('backups.listing.tooltipPreservedBackup')"></i>
|
||||
|
||||
Reference in New Issue
Block a user