=> {
+ await client.delete(`/backups/${filename}`);
};
diff --git a/frontend/src/pages/Backups.tsx b/frontend/src/pages/Backups.tsx
index 4ec7495c..fd4f609a 100644
--- a/frontend/src/pages/Backups.tsx
+++ b/frontend/src/pages/Backups.tsx
@@ -8,6 +8,12 @@ import { getBackups, createBackup, restoreBackup, deleteBackup } from '../api/ba
import { getSettings, updateSetting } from '../api/settings'
import { Loader2, Download, RotateCcw, Plus, Archive, Trash2, Save } from 'lucide-react'
+const formatSize = (bytes: number): string => {
+ if (bytes < 1024) return `${bytes} B`
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(2)} KB`
+ return `${(bytes / 1024 / 1024).toFixed(2)} MB`
+}
+
export default function Backups() {
const queryClient = useQueryClient()
const [interval, setInterval] = useState('7')
@@ -165,10 +171,10 @@ export default function Backups() {
{backup.filename}
|
- {(backup.size / 1024 / 1024).toFixed(2)} MB
+ {formatSize(backup.size)}
|
- {new Date(backup.created_at).toLocaleString()}
+ {new Date(backup.time).toLocaleString()}
|
|