Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/api-client/src/modules/archon/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,10 @@ export namespace Archon {
export type BackupsQueueWithOptionsResponse = BackupsQueueResponse & {
options: WorldBackupOptions
next_auto_backup_at: string | null
/** How many backups occupy the manual backup pool. Manual backups can't be created once this reaches `split_manual`. */
manual_count: number
/** How many backups occupy the automatic backup pool. The oldest ones rotate out once this exceeds `split_automatic`. */
auto_count: number
}

export type PatchWorldBackupOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,6 @@ const messages = defineMessages({
},
})

const LIVE_STATUSES: Backup['status'][] = ['pending', 'in_progress', 'done']

const { formatMessage } = useVIntl()
const formatRelativeTime = useRelativeTime()
const { formatFrequency } = useBackupIntervalFormat()
Expand All @@ -335,6 +333,7 @@ const { canManageBackups, permissionDeniedMessage } = useServerPermissions()

const {
query,
data,
backups,
deletedBackups,
options,
Expand Down Expand Up @@ -378,10 +377,8 @@ const { highlightedBackupId } = useFocusedBackup(
)

const autoEnabled = computed(() => (options.value?.split_automatic ?? 0) > 0)
const autoUsed = computed(() => backups.value.filter((b) => b.rotates_at).length)
const manualUsed = computed(
() => backups.value.filter((b) => !b.automated && LIVE_STATUSES.includes(b.status)).length,
)
const autoUsed = computed(() => data.value?.auto_count ?? 0)
const manualUsed = computed(() => data.value?.manual_count ?? 0)

const nextAutoBackupLabel = computed(() => {
const next = nextAutoBackupAt.value
Expand Down
Loading