feat(backups): show estimated time remaining on backup progress

This commit is contained in:
bcrooker 2026-03-01 21:11:48 -05:00
parent d5da6d4562
commit 8e24c6a8d8
2 changed files with 8 additions and 0 deletions

View file

@ -4141,6 +4141,7 @@ export type GetBackupProgressResponses = {
repositoryName: string;
scheduleId: string;
seconds_elapsed: number;
seconds_remaining: number;
total_bytes: number;
total_files: number;
volumeName: string;

View file

@ -46,6 +46,9 @@ export const BackupProgressCard = ({ scheduleShortId, initialProgress }: Props)
const currentFile = progress?.current_files?.[0] || "";
const fileName = currentFile.split("/").pop() || currentFile;
const speed = progress ? formatBytes(progress.bytes_done / progress.seconds_elapsed) : null;
const eta = progress?.seconds_remaining != null && progress.seconds_remaining > 0
? formatDuration(progress.seconds_remaining)
: null;
return (
<Card className="p-4">
@ -96,6 +99,10 @@ export const BackupProgressCard = ({ scheduleShortId, initialProgress }: Props)
{progress ? (progress.seconds_elapsed > 0 ? `${speed?.text} ${speed?.unit}/s` : "Calculating...") : "—"}
</p>
</div>
<div>
<p className="text-xs uppercase text-muted-foreground">ETA</p>
<p className="font-medium">{progress ? (eta ?? "Calculating...") : "—"}</p>
</div>
</div>
<div className="pt-2 border-t border-border">