mirror of
https://github.com/modrinth/code.git
synced 2026-09-05 06:19:11 +00:00
feat: backups page cleanup before worlds (#5844)
* feat: card alignment + fix modals * feat: change admon title in restore alert modal * fix: lint * feat: backups queue api into api-client * feat: impl backup queue api endpoints into frontend * feat: ack fix * feat: bulk actions * feat: bulk delete impl * fix: lint * fix: align error states * fix: transition group * feat: ready for qa * fix: lint * feat: qa * feat: stacked admonitions component * fix: issues with stacking * feat: hook up admonition stacking + fix app csp for staging kyros nodes * fix: logs.vue * qa: close stack on admonitions click * fix: all problems with stacked admonitions * qa: admonition cleanup and copy overhaul draft * fix: qa issues padding * fix: padding bug * feat: qa * fix: intercom in app csp bug * fix: positioning intercom * feat: loading overlay on top of console + admon consistency changes * feat: scroll indicator fade in backup delete modal + admon timestamp fix * feat: move action bar behind modal * fix: lint + i18n * fix: server ping spam on filter (cache but clear on unmount) * fix: 1 admon fade in flicker issue * chore: temp staging undo * qa: changes * fix: lint * chore: revert staging to use staging * fix: scoping
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
import type { Archon } from '@modrinth/api-client'
|
||||
import type { Meta, StoryObj } from '@storybook/vue3-vite'
|
||||
|
||||
import BackupItem from '../../components/servers/backups/BackupItem.vue'
|
||||
|
||||
const meta = {
|
||||
title: 'Servers/BackupItem',
|
||||
component: BackupItem,
|
||||
args: {
|
||||
preview: false,
|
||||
showCopyIdAction: false,
|
||||
showDebugInfo: false,
|
||||
restoreDisabled: undefined,
|
||||
},
|
||||
} satisfies Meta<typeof BackupItem>
|
||||
|
||||
export default meta
|
||||
type Story = StoryObj<typeof meta>
|
||||
|
||||
function makeBackup(
|
||||
overrides: Partial<Archon.BackupsQueue.v1.BackupQueueBackup> = {},
|
||||
): Archon.BackupsQueue.v1.BackupQueueBackup {
|
||||
return {
|
||||
id: 'backup-001',
|
||||
name: 'Backup #5',
|
||||
created_at: new Date(Date.now() - 1000 * 60 * 10).toISOString(),
|
||||
automated: false,
|
||||
status: 'done',
|
||||
locked: false,
|
||||
history: [],
|
||||
...overrides,
|
||||
}
|
||||
}
|
||||
|
||||
export const Default: Story = {
|
||||
name: 'Default (manual)',
|
||||
args: {
|
||||
backup: makeBackup({ name: 'Base finished!!' }),
|
||||
},
|
||||
}
|
||||
|
||||
export const Automated: Story = {
|
||||
name: 'Automated',
|
||||
args: {
|
||||
backup: makeBackup({ automated: true, name: 'Backup #2' }),
|
||||
},
|
||||
}
|
||||
|
||||
export const Preview: Story = {
|
||||
name: 'Preview (compact, used in delete modal)',
|
||||
args: {
|
||||
backup: makeBackup({ name: 'Base finished!!' }),
|
||||
preview: true,
|
||||
},
|
||||
}
|
||||
|
||||
export const RestoreDisabled: Story = {
|
||||
name: 'Restore disabled (server running)',
|
||||
args: {
|
||||
backup: makeBackup({ name: 'Backup #5', automated: true }),
|
||||
restoreDisabled: 'Cannot restore backup while server is running',
|
||||
},
|
||||
}
|
||||
|
||||
export const CommonStates: Story = {
|
||||
render: () => ({
|
||||
components: { BackupItem },
|
||||
setup() {
|
||||
const now = new Date(Date.now() - 1000 * 60 * 10).toISOString()
|
||||
|
||||
function makeBackup(
|
||||
overrides: Partial<Archon.BackupsQueue.v1.BackupQueueBackup>,
|
||||
): Archon.BackupsQueue.v1.BackupQueueBackup {
|
||||
return {
|
||||
id: 'backup-001',
|
||||
name: 'Backup #5',
|
||||
created_at: now,
|
||||
automated: false,
|
||||
status: 'done',
|
||||
locked: false,
|
||||
history: [],
|
||||
...overrides,
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
manual: makeBackup({ name: 'Base finished!!' }),
|
||||
automated: makeBackup({ automated: true, name: 'Backup #2' }),
|
||||
}
|
||||
},
|
||||
template: /* html */ `
|
||||
<div style="display: flex; flex-direction: column; gap: 0.75rem; max-width: 900px;">
|
||||
<BackupItem :backup="manual" />
|
||||
<BackupItem :backup="automated" />
|
||||
<BackupItem :backup="manual" preview />
|
||||
</div>
|
||||
`,
|
||||
}),
|
||||
}
|
||||
Reference in New Issue
Block a user