diff --git a/resources/scripts/components/server/backups/BackupContainer.tsx b/resources/scripts/components/server/backups/BackupContainer.tsx index 3cc0f1757..dee9342c9 100644 --- a/resources/scripts/components/server/backups/BackupContainer.tsx +++ b/resources/scripts/components/server/backups/BackupContainer.tsx @@ -7,6 +7,7 @@ import { httpErrorToHuman } from '@/api/http'; import Can from '@/components/elements/Can'; import CreateBackupButton from '@/components/server/backups/CreateBackupButton'; import FlashMessageRender from '@/components/FlashMessageRender'; +import BackupRow from '@/components/server/backups/BackupRow'; export default () => { const { uuid } = useServer(); @@ -40,13 +41,11 @@ export default () => {

:
- { - backups.map(backup => ( -
- {backup.uuid} -
- )) - } + {backups.map((backup, index) => )}
} diff --git a/resources/scripts/components/server/backups/BackupRow.tsx b/resources/scripts/components/server/backups/BackupRow.tsx new file mode 100644 index 000000000..ec98cc885 --- /dev/null +++ b/resources/scripts/components/server/backups/BackupRow.tsx @@ -0,0 +1,47 @@ +import React from 'react'; +import { ServerBackup } from '@/api/server/backups/getServerBackups'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; +import { faArchive } from '@fortawesome/free-solid-svg-icons/faArchive'; +import format from 'date-fns/format'; +import distanceInWordsToNow from 'date-fns/distance_in_words_to_now' +import Spinner from '@/components/elements/Spinner'; +import { faCloudDownloadAlt } from '@fortawesome/free-solid-svg-icons/faCloudDownloadAlt'; + +interface Props { + backup: ServerBackup; + className?: string; +} + +export default ({ backup, className }: Props) => { + return ( +
+
+ +
+
+

{backup.name}

+

{backup.uuid}

+
+
+

+ {distanceInWordsToNow(backup.createdAt, { includeSeconds: true, addSuffix: true })} +

+

Created

+
+
+ {!backup.completedAt ? +
+ +
+ : + + + + } +
+
+ ); +};