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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
:show-copy-id-action="appSettings.devMode"
:auth-user="authUser"
:navigate-to-billing="() => openUrl('https://modrinth.com/settings/billing')"
:navigate-to-admin-billing="
(ownerId: string) => openUrl(`https://modrinth.com/admin/billing/${ownerId}`)
"
:navigate-to-servers="() => router.push('/hosting/manage')"
:browse-modpacks="
({ serverId: sid, worldId: wid, from }) => {
Expand Down
1 change: 1 addition & 0 deletions apps/frontend/src/pages/hosting/manage/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:products="products"
:auth-user="authUser"
:navigate-to-billing="() => router.push('/settings/billing')"
:navigate-to-admin-billing="(ownerId: string) => router.push(`/admin/billing/${ownerId}`)"
:navigate-to-servers="() => router.push('/hosting/manage')"
constrain-width
:browse-modpacks="
Expand Down
8 changes: 8 additions & 0 deletions packages/api-client/src/modules/archon/backups-queue/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ export class ArchonBackupsQueueV1Module extends AbstractModule {
)
}

/** POST /v1/servers/:server_id/worlds/:world_id/backups-queue/:backup_id/undelete */
public async undelete(serverId: string, worldId: string, backupId: string): Promise<void> {
await this.client.request<void>(
`/servers/${serverId}/worlds/${worldId}/backups-queue/${backupId}/undelete`,
{ api: 'archon', version: 1, method: 'POST' },
)
}

/** 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>(
Expand Down
31 changes: 31 additions & 0 deletions packages/api-client/src/modules/archon/servers/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,35 @@ export class ArchonServersInternalModule extends AbstractModule {
method: 'DELETE',
})
}

/**
* Temporarily lift a suspended server's suspension, or update its current temporary lift.
* POST /_internal/suspensions/server/:server_id/lift
*/
public async liftSuspension(
serverId: string,
request: Archon.Servers.Internal.LiftSuspensionRequest,
): Promise<Archon.Servers.Internal.LiftSuspensionResponse> {
return this.client.request<Archon.Servers.Internal.LiftSuspensionResponse>(
`/suspensions/server/${serverId}/lift`,
{
api: 'archon',
version: 'internal',
method: 'POST',
body: request,
},
)
}

/**
* End the temporary lift of a server's suspension before it expires.
* POST /_internal/suspensions/server/:server_id/resuspend
*/
public async resuspend(serverId: string): Promise<void> {
return this.client.request<void>(`/suspensions/server/${serverId}/resuspend`, {
api: 'archon',
version: 'internal',
method: 'POST',
})
}
}
47 changes: 47 additions & 0 deletions packages/api-client/src/modules/archon/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ export namespace Archon {
| 'changed_server_subdomain'
| 'server_reallocated'
| 'server_plan_changed'
| 'server_suspended'
| 'server_unsuspended'
| 'server_suspension_lifted'
| 'server_resuspended'
| 'user_invited'
| 'user_invite_revoked'
| 'user_permission_modified'
Expand Down Expand Up @@ -589,6 +593,18 @@ export namespace Archon {
export type LockServerRequest = {
reason: string
}

export type LiftSuspensionRequest = {
/** How long to lift the suspension for, in minutes from now. */
minutes: number
/** Whether to prevent the server from starting while the suspension is lifted. */
restrict_power: boolean
}

export type LiftSuspensionResponse = {
lifted_until: string
restrict_power: boolean
}
}

export namespace v0 {
Expand Down Expand Up @@ -644,6 +660,8 @@ export namespace Archon {
used_backup_quota: number
status: Status
suspension_reason: SuspensionReason | null
/** Set while support temporarily lifts the server's suspension. */
suspension_lift?: SuspensionLift | null
loader: Loader | null
loader_version: string | null
mc_version: string | null
Expand All @@ -662,6 +680,13 @@ export namespace Archon {
medal_expires?: string
}

export type SuspensionLift = {
/** When the server is suspended again. */
until: string
/** Whether the server is prevented from starting while the suspension is lifted. */
restrict_power: boolean
}

export type UserScope = number

export type Net = {
Expand Down Expand Up @@ -970,9 +995,31 @@ export namespace Archon {
history: BackupQueueOperation[]
}

/** A backup scheduled for deletion. Only listed for support agents. */
export type DeletedBackupQueueBackup = {
id: string
name: string
created_at: string
status: BackupStatus
automated: boolean
created_by?: UserInfo | null
/** When the backup's data becomes eligible for permanent deletion. */
scheduled_delete: string
/** Until when the backup can be undeleted. May be in the past. */
undelete_deadline: string
deleted_suspension: boolean
can_undelete: boolean
repository_id: number
restic_snapshot_id?: string | null
/** Whether the backup's snapshot was forgotten from its repository. */
permanently_deleted: boolean
}

export type BackupsQueueResponse = {
active_operations: ActiveOperation[]
backups: BackupQueueBackup[]
/** Only present for support agents. */
deleted_backups?: DeletedBackupQueueBackup[] | null
}

export type WorldBackupOptions = {
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/components/base/ErrorInformationCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
{{ action.label }}
</Button>

<slot name="actions" />

<Button v-if="errorDetails" size="xl" class="flex-1" @click="copyErrorInformation">
<CopyIcon v-if="!infoCopied" class="size-4" />
<CheckIcon v-else class="size-4" />
Expand Down
Loading
Loading