You've already forked AstralRinth
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,93 @@
|
||||
import { AbstractModule } from '../../../core/abstract-module'
|
||||
import type { Archon } from '../types'
|
||||
|
||||
export class ArchonBackupsQueueV1Module extends AbstractModule {
|
||||
public getModuleID(): string {
|
||||
return 'archon_backups_queue_v1'
|
||||
}
|
||||
|
||||
/** GET /v1/servers/:server_id/worlds/:world_id/backups-queue */
|
||||
public async list(
|
||||
serverId: string,
|
||||
worldId: string,
|
||||
): Promise<Archon.BackupsQueue.v1.BackupsQueueResponse> {
|
||||
return this.client.request<Archon.BackupsQueue.v1.BackupsQueueResponse>(
|
||||
`/servers/${serverId}/worlds/${worldId}/backups-queue`,
|
||||
{ api: 'archon', version: 1, method: 'GET' },
|
||||
)
|
||||
}
|
||||
|
||||
/** POST /v1/servers/:server_id/worlds/:world_id/backups-queue */
|
||||
public async create(
|
||||
serverId: string,
|
||||
worldId: string,
|
||||
request: Archon.BackupsQueue.v1.BackupRequest,
|
||||
): Promise<Archon.BackupsQueue.v1.PostBackupQueueResponse> {
|
||||
return this.client.request<Archon.BackupsQueue.v1.PostBackupQueueResponse>(
|
||||
`/servers/${serverId}/worlds/${worldId}/backups-queue`,
|
||||
{ api: 'archon', version: 1, method: 'POST', body: request },
|
||||
)
|
||||
}
|
||||
|
||||
/** POST /v1/servers/:server_id/worlds/:world_id/backups-queue/history/create/:operation_id/ack */
|
||||
public async ackCreate(serverId: string, worldId: string, operationId: number): Promise<void> {
|
||||
await this.client.request<void>(
|
||||
`/servers/${serverId}/worlds/${worldId}/backups-queue/history/create/${operationId}/ack`,
|
||||
{ api: 'archon', version: 1, method: 'POST' },
|
||||
)
|
||||
}
|
||||
|
||||
/** POST /v1/servers/:server_id/worlds/:world_id/backups-queue/history/restore/:operation_id/ack */
|
||||
public async ackRestore(serverId: string, worldId: string, operationId: number): Promise<void> {
|
||||
await this.client.request<void>(
|
||||
`/servers/${serverId}/worlds/${worldId}/backups-queue/history/restore/${operationId}/ack`,
|
||||
{ api: 'archon', version: 1, method: 'POST' },
|
||||
)
|
||||
}
|
||||
|
||||
/** DELETE /v1/servers/:server_id/worlds/:world_id/backups-queue/:backup_id */
|
||||
public async delete(serverId: string, worldId: string, backupId: string): Promise<void> {
|
||||
await this.client.request<void>(
|
||||
`/servers/${serverId}/worlds/${worldId}/backups-queue/${backupId}`,
|
||||
{
|
||||
api: 'archon',
|
||||
version: 1,
|
||||
method: 'DELETE',
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
/** POST /v1/servers/:server_id/worlds/:world_id/backups-queue/delete-many */
|
||||
public async deleteMany(serverId: string, worldId: string, backupIds: string[]): Promise<void> {
|
||||
await this.client.request<void>(
|
||||
`/servers/${serverId}/worlds/${worldId}/backups-queue/delete-many`,
|
||||
{
|
||||
api: 'archon',
|
||||
version: 1,
|
||||
method: 'POST',
|
||||
body: { backup_ids: backupIds } satisfies Archon.BackupsQueue.v1.DeleteManyBackupRequest,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
/** POST /v1/servers/:server_id/worlds/:world_id/backups-queue/:backup_id/restore */
|
||||
public async restore(
|
||||
serverId: string,
|
||||
worldId: string,
|
||||
backupId: string,
|
||||
request: Archon.BackupsQueue.v1.BackupRequest,
|
||||
): Promise<void> {
|
||||
await this.client.request<void>(
|
||||
`/servers/${serverId}/worlds/${worldId}/backups-queue/${backupId}/restore`,
|
||||
{ api: 'archon', version: 1, method: 'POST', body: request },
|
||||
)
|
||||
}
|
||||
|
||||
/** POST /v1/servers/:server_id/worlds/:world_id/backups-queue/:backup_id/retry */
|
||||
public async retry(serverId: string, worldId: string, backupId: string): Promise<void> {
|
||||
await this.client.request<void>(
|
||||
`/servers/${serverId}/worlds/${worldId}/backups-queue/${backupId}/retry`,
|
||||
{ api: 'archon', version: 1, method: 'POST' },
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user