From 08c876243febb99a68740c449055e850f37d740e Mon Sep 17 00:00:00 2001 From: garethgeorge Date: Wed, 14 Feb 2024 23:45:03 -0800 Subject: [PATCH] fix: hide delete operation button if operation is in progress or pending --- webui/src/components/OperationTree.tsx | 44 ++++++++++++++------------ 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/webui/src/components/OperationTree.tsx b/webui/src/components/OperationTree.tsx index 144c521b..82997f5e 100644 --- a/webui/src/components/OperationTree.tsx +++ b/webui/src/components/OperationTree.tsx @@ -281,6 +281,28 @@ const BackupView = ({ backup }: { backup?: BackupInfo }) => { } } + const deleteButton = backup.snapshotId ? + + Forget (Destructive) + : { + backrestService.clearHistory(new ClearHistoryRequest({ + ops: backup.operations.map((op) => op.id), + })) + }} + > + Delete Event + ; + return
{ }}>

Backup on {formatTime(backup.displayTime)}

- {backup.snapshotId ? - - Forget Snapshot (Destructive) - : { - backrestService.clearHistory(new ClearHistoryRequest({ - ops: backup.operations.map((op) => op.id), - })) - }} - > - Delete Event - } + {backup.status !== OperationStatus.STATUS_PENDING && backup.status != OperationStatus.STATUS_INPROGRESS ? deleteButton : null}
op && !shouldHideOperation(op)} />