mirror of
https://github.com/pyrohost/pyrodactyl.git
synced 2026-04-06 04:01:58 +02:00
fix: linting
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import ActionButton from '@/components/elements/ActionButton';
|
import ActionButton from '@/components/elements/ActionButton';
|
||||||
import Can from '@/components/elements/Can';
|
import Can from '@/components/elements/Can';
|
||||||
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
|
|
||||||
import { Dialog } from '@/components/elements/dialog';
|
|
||||||
import {
|
import {
|
||||||
DropdownMenu,
|
DropdownMenu,
|
||||||
DropdownMenuContent,
|
DropdownMenuContent,
|
||||||
@@ -11,16 +9,23 @@ import {
|
|||||||
DropdownMenuSeparator,
|
DropdownMenuSeparator,
|
||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
} from '@/components/elements/DropdownMenu';
|
} from '@/components/elements/DropdownMenu';
|
||||||
|
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
|
||||||
|
import { Dialog } from '@/components/elements/dialog';
|
||||||
import HugeIconsAlert from '@/components/elements/hugeicons/Alert';
|
import HugeIconsAlert from '@/components/elements/hugeicons/Alert';
|
||||||
import HugeIconsCloudUp from '@/components/elements/hugeicons/CloudUp';
|
import HugeIconsCloudUp from '@/components/elements/hugeicons/CloudUp';
|
||||||
import HugeIconsDelete from '@/components/elements/hugeicons/Delete';
|
import HugeIconsDelete from '@/components/elements/hugeicons/Delete';
|
||||||
import HugeIconsFileDownload from '@/components/elements/hugeicons/FileDownload';
|
import HugeIconsFileDownload from '@/components/elements/hugeicons/FileDownload';
|
||||||
import HugeIconsFileSecurity from '@/components/elements/hugeicons/FileSecurity';
|
import HugeIconsFileSecurity from '@/components/elements/hugeicons/FileSecurity';
|
||||||
import HugeIconsHamburger from '@/components/elements/hugeicons/hamburger';
|
|
||||||
import HugeIconsPencil from '@/components/elements/hugeicons/Pencil';
|
import HugeIconsPencil from '@/components/elements/hugeicons/Pencil';
|
||||||
|
import HugeIconsHamburger from '@/components/elements/hugeicons/hamburger';
|
||||||
|
|
||||||
import http, { httpErrorToHuman } from '@/api/http';
|
import http, { httpErrorToHuman } from '@/api/http';
|
||||||
import { restoreServerBackup, renameServerBackup, deleteServerBackup, getServerBackupDownloadUrl } from '@/api/server/backups';
|
import {
|
||||||
|
deleteServerBackup,
|
||||||
|
getServerBackupDownloadUrl,
|
||||||
|
renameServerBackup,
|
||||||
|
restoreServerBackup,
|
||||||
|
} from '@/api/server/backups';
|
||||||
import { ServerBackup } from '@/api/server/types';
|
import { ServerBackup } from '@/api/server/types';
|
||||||
import getServerBackups from '@/api/swr/getServerBackups';
|
import getServerBackups from '@/api/swr/getServerBackups';
|
||||||
|
|
||||||
@@ -112,9 +117,9 @@ const BackupContextMenu = ({ backup }: Props) => {
|
|||||||
b.uuid !== backup.uuid
|
b.uuid !== backup.uuid
|
||||||
? b
|
? b
|
||||||
: {
|
: {
|
||||||
...b,
|
...b,
|
||||||
isLocked: !b.isLocked,
|
isLocked: !b.isLocked,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
false,
|
false,
|
||||||
@@ -137,9 +142,9 @@ const BackupContextMenu = ({ backup }: Props) => {
|
|||||||
b.uuid !== backup.uuid
|
b.uuid !== backup.uuid
|
||||||
? b
|
? b
|
||||||
: {
|
: {
|
||||||
...b,
|
...b,
|
||||||
name: newName.trim(),
|
name: newName.trim(),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
false,
|
false,
|
||||||
@@ -184,16 +189,10 @@ const BackupContextMenu = ({ backup }: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Dialog
|
<Dialog open={modal === 'rename'} onClose={() => setModal('')} title='Rename Backup'>
|
||||||
open={modal === 'rename'}
|
|
||||||
onClose={() => setModal('')}
|
|
||||||
title="Rename Backup"
|
|
||||||
>
|
|
||||||
<div className='space-y-4'>
|
<div className='space-y-4'>
|
||||||
<div>
|
<div>
|
||||||
<label className='block text-sm font-medium text-zinc-200 mb-2'>
|
<label className='block text-sm font-medium text-zinc-200 mb-2'>Backup Name</label>
|
||||||
Backup Name
|
|
||||||
</label>
|
|
||||||
<input
|
<input
|
||||||
type='text'
|
type='text'
|
||||||
value={newName}
|
value={newName}
|
||||||
@@ -226,16 +225,13 @@ const BackupContextMenu = ({ backup }: Props) => {
|
|||||||
>
|
>
|
||||||
This backup will no longer be protected from automated or accidental deletions.
|
This backup will no longer be protected from automated or accidental deletions.
|
||||||
</Dialog.Confirm>
|
</Dialog.Confirm>
|
||||||
<Dialog
|
<Dialog open={modal === 'restore'} onClose={() => setModal('')} title='Restore Backup'>
|
||||||
open={modal === 'restore'}
|
|
||||||
onClose={() => setModal('')}
|
|
||||||
title="Restore Backup"
|
|
||||||
>
|
|
||||||
<div className='space-y-4'>
|
<div className='space-y-4'>
|
||||||
<div className='space-y-2'>
|
<div className='space-y-2'>
|
||||||
<p className='text-sm font-medium text-zinc-200'>"{backup.name}"</p>
|
<p className='text-sm font-medium text-zinc-200'>"{backup.name}"</p>
|
||||||
<p className='text-sm text-zinc-400'>
|
<p className='text-sm text-zinc-400'>
|
||||||
Your server will be stopped during the restoration process. You will not be able to control the power state, access the file manager, or create additional backups until completed.
|
Your server will be stopped during the restoration process. You will not be able to control
|
||||||
|
the power state, access the file manager, or create additional backups until completed.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -247,7 +243,8 @@ const BackupContextMenu = ({ backup }: Props) => {
|
|||||||
Destructive Action - Complete Server Restore
|
Destructive Action - Complete Server Restore
|
||||||
</h4>
|
</h4>
|
||||||
<p className='text-xs text-red-300'>
|
<p className='text-xs text-red-300'>
|
||||||
All current files and server configuration will be deleted and replaced with the backup data. This action cannot be undone.
|
All current files and server configuration will be deleted and replaced with the
|
||||||
|
backup data. This action cannot be undone.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -258,15 +255,8 @@ const BackupContextMenu = ({ backup }: Props) => {
|
|||||||
<ActionButton onClick={() => setModal('')} variant='secondary'>
|
<ActionButton onClick={() => setModal('')} variant='secondary'>
|
||||||
Cancel
|
Cancel
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
<ActionButton
|
<ActionButton onClick={() => doRestorationAction()} variant='danger' disabled={countdown > 0}>
|
||||||
onClick={() => doRestorationAction()}
|
{countdown > 0 ? `Delete All & Restore (${countdown}s)` : 'Delete All & Restore Backup'}
|
||||||
variant='danger'
|
|
||||||
disabled={countdown > 0}
|
|
||||||
>
|
|
||||||
{countdown > 0
|
|
||||||
? `Delete All & Restore (${countdown}s)`
|
|
||||||
: 'Delete All & Restore Backup'
|
|
||||||
}
|
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
</Dialog.Footer>
|
</Dialog.Footer>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|||||||
Reference in New Issue
Block a user