Merge branch 'bcrooker-features/show-estimated-time2'

This commit is contained in:
Nicolas Meienberger 2026-03-11 19:06:29 +01:00
commit f6169ab27e
6 changed files with 27 additions and 12 deletions

1
.gitignore vendored
View file

@ -41,3 +41,4 @@ openapi-ts-error-*.log
tmp/
qa-output
.worktrees/

View file

@ -204,8 +204,8 @@ export type GetPublicSsoProvidersResponses = {
*/
200: {
providers: Array<{
organizationSlug: string;
providerId: string;
organizationSlug: string;
}>;
};
};
@ -224,20 +224,20 @@ export type GetSsoSettingsResponses = {
* SSO settings for the active organization
*/
200: {
invitations: Array<{
email: string;
expiresAt: string;
id: string;
role: string;
status: string;
}>;
providers: Array<{
autoLinkMatchingEmails: boolean;
domain: string;
issuer: string;
organizationId: string | null;
providerId: string;
type: string;
issuer: string;
domain: string;
autoLinkMatchingEmails: boolean;
organizationId: string | null;
}>;
invitations: Array<{
id: string;
email: string;
role: string;
status: string;
expiresAt: string;
}>;
};
};

View file

@ -46,6 +46,7 @@ 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 ? formatDuration(progress.seconds_remaining) : null;
return (
<Card className="p-4">
@ -96,6 +97,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">

View file

@ -31,6 +31,7 @@ export const resticBackupOutputSchema = resticBackupRunSummarySchema.extend({
export const resticBackupProgressMetricsSchema = z.object({
seconds_elapsed: z.number(),
seconds_remaining: z.number().default(0),
percent_done: z.number(),
total_files: z.number(),
files_done: z.number(),

View file

@ -107,6 +107,10 @@ export const backup = async (
if (options.onProgress) {
try {
const jsonData = JSON.parse(data);
if (jsonData.message_type !== "status") {
return;
}
const progressResult = resticBackupProgressSchema.safeParse(jsonData);
if (progressResult.success) {
options.onProgress(progressResult.data);

View file

@ -100,6 +100,10 @@ export const restore = async (
if (options.onProgress) {
try {
const jsonData = JSON.parse(data);
if (jsonData.message_type !== "status") {
return;
}
const progress = restoreProgressSchema.safeParse(jsonData);
if (progress.success) {
options.onProgress(progress.data);