diff --git a/internal/orchestrator/tasks/taskindexsnapshots.go b/internal/orchestrator/tasks/taskindexsnapshots.go index 3c9ec155..a21c4390 100644 --- a/internal/orchestrator/tasks/taskindexsnapshots.go +++ b/internal/orchestrator/tasks/taskindexsnapshots.go @@ -107,7 +107,7 @@ func indexSnapshotsHelper(ctx context.Context, st ScheduledTask, taskRunner Task FlowId: flowID, InstanceId: instanceID, UnixTimeStartMs: snapshotProto.UnixTimeMs, - UnixTimeEndMs: snapshotProto.UnixTimeMs, + UnixTimeEndMs: snapshotProto.UnixTimeMs + snapshot.SnapshotSummary.DurationMs(), Status: v1.OperationStatus_STATUS_SUCCESS, SnapshotId: snapshotProto.Id, Op: &v1.Operation_OperationIndexSnapshot{ diff --git a/webui/src/components/OperationRow.tsx b/webui/src/components/OperationRow.tsx index 43e9a871..f5db7801 100644 --- a/webui/src/components/OperationRow.tsx +++ b/webui/src/components/OperationRow.tsx @@ -25,7 +25,11 @@ import { InfoCircleOutlined, FileSearchOutlined, } from "@ant-design/icons"; -import { BackupProgressEntry, ResticSnapshot } from "../../gen/ts/v1/restic_pb"; +import { + BackupProgressEntry, + ResticSnapshot, + SnapshotSummary, +} from "../../gen/ts/v1/restic_pb"; import { DisplayType, detailsForOperation, @@ -35,6 +39,7 @@ import { import { SnapshotBrowser } from "./SnapshotBrowser"; import { formatBytes, + formatDuration, formatTime, normalizeSnapshotId, } from "../lib/formatting"; @@ -191,7 +196,9 @@ export const OperationRow = ({ const expandedBodyItems: string[] = []; if (operation.op.case === "operationBackup") { - expandedBodyItems.push("details"); + if (operation.status === OperationStatus.STATUS_INPROGRESS) { + expandedBodyItems.push("details"); + } const backupOp = operation.op.value; bodyItems.push({ key: "details", @@ -312,29 +319,82 @@ export const OperationRow = ({ }; const SnapshotDetails = ({ snapshot }: { snapshot: ResticSnapshot }) => { + const summary: Partial = snapshot.summary || {}; + + const rows: React.ReactNode[] = [ + + + Host +
+ {snapshot.hostname} + + + Username +
+ {snapshot.hostname} + + + Tags +
+ {snapshot.tags?.join(", ")} + +
, + ]; + + if ( + summary.filesNew || + summary.filesChanged || + summary.filesUnmodified || + summary.dataAdded || + summary.totalFilesProcessed || + summary.totalBytesProcessed + ) { + rows.push( + + + Files Added +
+ {"" + summary.filesNew} + + + Files Changed +
+ {"" + summary.filesChanged} + + + Files Unmodified +
+ {"" + summary.filesUnmodified} + +
+ ); + rows.push( + + + Bytes Added +
+ {formatBytes(Number(summary.dataAdded))} + + + Bytes Processed +
+ {formatBytes(Number(summary.totalBytesProcessed))} + + + Files Processed +
+ {"" + summary.totalFilesProcessed} + +
+ ); + } + return ( <> Snapshot ID: - {normalizeSnapshotId(snapshot.id!)} + {normalizeSnapshotId(snapshot.id!)} {rows} - - - Host -
- {snapshot.hostname} - - - Username -
- {snapshot.hostname} - - - Tags -
- {snapshot.tags?.join(", ")} - -
); }; diff --git a/webui/src/state/oplog.ts b/webui/src/state/oplog.ts index 28707362..02ad3c80 100644 --- a/webui/src/state/oplog.ts +++ b/webui/src/state/oplog.ts @@ -507,7 +507,11 @@ export const detailsForOperation = ( if (op.status === OperationStatus.STATUS_INPROGRESS) { displayState += " for " + formatDuration(duration); } else { - displayState += " in " + formatDuration(duration); + if (op.op.case === "operationIndexSnapshot") { + displayState += " created in " + formatDuration(duration); + } else { + displayState += " took " + formatDuration(duration); + } } }