feat: qa improvements for backups page (#4857)

* feat: fix backup action disabling logic

* feat: allow actions when backup is being created

* feat: qa fixes

* feat: backups empty state

* fix: lint

* intl:extract

---------

Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
Calum H.
2025-12-05 01:48:34 +00:00
committed by GitHub
parent 0f1f27d450
commit 41e4086973
8 changed files with 139 additions and 88 deletions

View File

@@ -2558,9 +2558,6 @@
"search.filter.locked.server.sync": {
"message": "Sync with server"
},
"servers.backup.create.in-progress.tooltip": {
"message": "Backup creation in progress"
},
"servers.backup.restore.in-progress.tooltip": {
"message": "Backup restore in progress"
},

View File

@@ -120,7 +120,7 @@
<div
v-else-if="serverData"
data-pyro-server-manager-root
class="experimental-styles-within mobile-blurred-servericon relative mx-auto mb-6 box-border flex min-h-screen w-full min-w-0 max-w-[1280px] flex-col gap-6 px-6 transition-all duration-300"
class="experimental-styles-within mobile-blurred-servericon relative mx-auto mb-12 box-border flex min-h-screen w-full min-w-0 max-w-[1280px] flex-col gap-6 px-6 transition-all duration-300"
:style="{
'--server-bg-image': serverData.image
? `url(${serverData.image})`
@@ -738,21 +738,9 @@ const handleBackupProgress = (data: Archon.Websocket.v0.WSBackupProgressEvent) =
if (backup?.ongoing && attempt < 3) {
// retry 3 times max, archon is slow compared to ws state
// jank as hell
setTimeout(() => attemptCleanup(attempt + 1), 1000)
return
}
// clean up on success/3 attempts failed hope and pray
const entry = backupsState.get(backupId)
if (entry) {
const { [data.task]: _, ...remaining } = entry
if (Object.keys(remaining).length === 0) {
backupsState.delete(backupId)
} else {
backupsState.set(backupId, remaining)
}
}
})
}
@@ -981,7 +969,7 @@ export type BackupInProgressReason = {
tooltip: MessageDescriptor
}
const RestoreInProgressReason = {
const restoreInProgressReason = {
type: 'restore',
tooltip: defineMessage({
id: 'servers.backup.restore.in-progress.tooltip',
@@ -989,21 +977,10 @@ const RestoreInProgressReason = {
}),
} satisfies BackupInProgressReason
const CreateInProgressReason = {
type: 'create',
tooltip: defineMessage({
id: 'servers.backup.create.in-progress.tooltip',
defaultMessage: 'Backup creation in progress',
}),
} satisfies BackupInProgressReason
const backupInProgress = computed(() => {
for (const entry of backupsState.values()) {
if (entry.create?.state === 'ongoing') {
return CreateInProgressReason
}
if (entry.restore?.state === 'ongoing') {
return RestoreInProgressReason
return restoreInProgressReason
}
}
return undefined