diff --git a/apps/dokploy/components/dashboard/database/backups/restore-backup.tsx b/apps/dokploy/components/dashboard/database/backups/restore-backup.tsx index 797e1ca8..69d37935 100644 --- a/apps/dokploy/components/dashboard/database/backups/restore-backup.tsx +++ b/apps/dokploy/components/dashboard/database/backups/restore-backup.tsx @@ -77,6 +77,14 @@ const RestoreBackupSchema = z.object({ type RestoreBackup = z.infer; +const formatBytes = (bytes: number): string => { + if (bytes === 0) return "0 Bytes"; + const k = 1024; + const sizes = ["Bytes", "KB", "MB", "GB", "TB"]; + const i = Math.floor(Math.log(bytes) / Math.log(k)); + return `${Number.parseFloat((bytes / k ** i).toFixed(2))} ${sizes[i]}`; +}; + export const RestoreBackup = ({ databaseId, databaseType, @@ -101,7 +109,7 @@ export const RestoreBackup = ({ const debouncedSetSearch = debounce((value: string) => { setDebouncedSearchTerm(value); - }, 150); + }, 350); const handleSearchChange = (value: string) => { setSearch(value); @@ -271,7 +279,7 @@ export const RestoreBackup = ({ )} - +