mirror of
https://github.com/garethgeorge/backrest.git
synced 2026-08-28 20:06:32 +00:00
fix: hide no-op prune operations
This commit is contained in:
@@ -92,7 +92,7 @@ func (t *PruneTask) Run(ctx context.Context) error {
|
||||
return fmt.Errorf("get next prune time: %w", err)
|
||||
}
|
||||
if nextPruneTime.After(time.Now()) {
|
||||
opPrune.OperationPrune.Output = "Skipping prune operation.\nPrune will next run at (or after): " + nextPruneTime.String() + "\nAdjust prune policy's MaxFrequencyDays to increase or decrease the interval."
|
||||
op.Status = v1.OperationStatus_STATUS_SYSTEM_CANCELLED
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,9 +88,6 @@ export const OperationList = ({
|
||||
|
||||
backupCollector.subscribe(() => {
|
||||
let backups = backupCollector.getAll();
|
||||
backups = backups.filter((b) => {
|
||||
return !shouldHideStatus(b.status);
|
||||
});
|
||||
backups.sort((a, b) => {
|
||||
return b.startTimeMs - a.startTimeMs;
|
||||
});
|
||||
@@ -134,9 +131,12 @@ export const OperationList = ({
|
||||
|
||||
return (
|
||||
<Card size="small" style={{ margin: "5px" }}>
|
||||
{ops.map((op) => (
|
||||
<OperationRow alertApi={alertApi!} key={op.id!} operation={toEop(op)} />
|
||||
))}
|
||||
{ops.map((op) => {
|
||||
if (shouldHideStatus(op.status!)) {
|
||||
return null;
|
||||
}
|
||||
return <OperationRow alertApi={alertApi!} key={op.id!} operation={toEop(op)} />
|
||||
})}
|
||||
</Card>
|
||||
);
|
||||
}}
|
||||
|
||||
@@ -60,9 +60,6 @@ export const OperationTree = ({
|
||||
|
||||
backupCollector.subscribe(() => {
|
||||
let backups = backupCollector.getAll();
|
||||
backups = backups.filter((b) => {
|
||||
return !shouldHideStatus(b.status);
|
||||
});
|
||||
backups.sort((a, b) => {
|
||||
return b.startTimeMs - a.startTimeMs;
|
||||
});
|
||||
|
||||
@@ -120,7 +120,7 @@ export class BackupInfoCollector {
|
||||
existing.endTimeMs = Math.max(existing.endTimeMs, newInfo.endTimeMs);
|
||||
existing.displayTime = new Date(existing.startTimeMs);
|
||||
existing.displayType = DisplayType.SNAPSHOT;
|
||||
if (newInfo.startTimeMs >= existing.startTimeMs) {
|
||||
if (newInfo.startTimeMs >= existing.startTimeMs && newInfo.status !== OperationStatus.STATUS_SYSTEM_CANCELLED) { // don't overwrite with cancelled status since that operation will be hidden.
|
||||
existing.status = newInfo.status; // use the latest status
|
||||
}
|
||||
existing.operations = _.uniqBy(
|
||||
@@ -219,16 +219,7 @@ export class BackupInfoCollector {
|
||||
public getAll(): BackupInfo[] {
|
||||
const arr = [];
|
||||
arr.push(...Object.values(this.backupByOpId));
|
||||
arr.push(
|
||||
...Object.values(this.backupBySnapshotId).filter((b) => {
|
||||
for (const op of b.operations) {
|
||||
if (op.operationIndexSnapshot && op.operationIndexSnapshot.forgot) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
})
|
||||
);
|
||||
arr.push(...Object.values(this.backupBySnapshotId));
|
||||
return arr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user