同步修改

This commit is contained in:
tianmo committed 2026-10-17 17:52:08 +08:00
1 parent d647453085
commit 9939943e31
6 files changed
+60 -27

No files matched your search

+6 -2
View File
@@ -60,8 +60,12 @@ const isPull = computed(() => direction.value === 'pull')
const canAbandon = computed(() =>
!props.busy
&& Boolean(props.resumableJob)
&& (isPull.value || Boolean(token.value.trim()))
)
const abandonConfirm = computed(() => (
isPull.value || token.value.trim()
? t('storage.backup.siteSyncAbandonConfirm')
: t('storage.backup.siteSyncAbandonWithoutTokenConfirm')
))
const directionSubtitle = computed(() => (
isPull.value
? t('storage.backup.siteSyncPullSubtitle')
@@ -110,7 +114,7 @@ function resumeSync() {
function abandonSync() {
if (!canAbandon.value || !props.resumableJob) return
if (!window.confirm(t('storage.backup.siteSyncAbandonConfirm'))) return
if (!window.confirm(abandonConfirm.value)) return
emit('sync', {
targetBaseUrl: targetBaseUrl.value.trim(),
token: token.value.trim(),
+10 -4
View File
@@ -268,11 +268,17 @@ export function useBackup() {
)
await refreshJobsFirstPage()
startPolling()
const cleanupPending = Boolean(
body.abandonJobId
&& data.job.payload.cleanupPending === true
)
toast.add({
title: body.abandonJobId
? t('storage.backup.siteSyncAbandoned')
: t('storage.backup.siteSyncStarted'),
color: 'success'
title: cleanupPending
? t('storage.backup.siteSyncAbandonedPendingCleanup')
: body.abandonJobId
? t('storage.backup.siteSyncAbandoned')
: t('storage.backup.siteSyncStarted'),
color: cleanupPending ? 'warning' : 'success'
})
return data.job
} catch (error: unknown) {