diff --git a/webui/src/state/oplog.ts b/webui/src/state/oplog.ts index d0d93407..fe2111e4 100644 --- a/webui/src/state/oplog.ts +++ b/webui/src/state/oplog.ts @@ -235,6 +235,7 @@ export class BackupInfoCollector { public addOperation(event: OperationEventType, op: Operation): BackupInfo | null { if (!this.filter(op)) { + this.removeOperation(op); return null; } const backupInfo = this.addHelper(op); @@ -245,7 +246,15 @@ export class BackupInfoCollector { // removeOperaiton is not quite correct from a formal standpoint; but will look correct in the UI. public removeOperation(op: Operation) { if (op.snapshotId) { - this.backupBySnapshotId.delete(op.snapshotId); + let existing = this.backupBySnapshotId.get(op.snapshotId); + if (existing) { + const operations = existing.operations.filter((o) => o.id !== op.id); + if (operations.length === 0) { + this.backupBySnapshotId.delete(op.snapshotId); + } else { + this.backupBySnapshotId.set(op.snapshotId, this.createBackup(operations)); + } + } } else { this.backupByOpId.delete(op.id); } @@ -293,7 +302,7 @@ export class BackupInfoCollector { ...this.backupByOpId.values(), ...this.backupBySnapshotId.values(), ]; - return arr.filter((b) => !b.forgotten); + return arr.filter((b) => !b.forgotten && !shouldHideStatus(b.status)); } public subscribe( diff --git a/webui/src/views/AddPlanModal.tsx b/webui/src/views/AddPlanModal.tsx index 9383d4da..5c3d90a9 100644 --- a/webui/src/views/AddPlanModal.tsx +++ b/webui/src/views/AddPlanModal.tsx @@ -477,21 +477,17 @@ export const AddPlanModal = ({ const RetentionPolicyView = () => { const form = Form.useFormInstance(); const retention = Form.useWatch('retention', { form, preserve: true }) as RetentionPolicy | undefined; - console.log("RETENTION: " + JSON.stringify(retention)); let [mode, setMode] = useState(0); useEffect(() => { if (!retention || (!retention.keepDaily && !retention.keepHourly && !retention.keepLastN && !retention.keepMonthly && !retention.keepWeekly && !retention.keepYearly)) { - console.log("RETENTION NOT SET"); setMode(0); } else if (!!retention.keepLastN) { - console.log("KEEP LAST N: ", retention.keepLastN); setMode(1); } else { setMode(2); } }, [retention]) - console.log("MODE: ", mode); let elem: React.ReactNode = null; if (mode === 0) {