From cb1284efc00c6aaca443aded76c9b9932f87f1cc Mon Sep 17 00:00:00 2001 From: Pedro Gonzalez Gomez Date: Tue, 30 May 2023 13:49:17 +0200 Subject: [PATCH] mgr/dashboard: disable promote on mirroring not enabled Fixes: https://tracker.ceph.com/issues/61507 Signed-off-by: Pedro Gonzalez Gomez (cherry picked from commit 999ce877b5fc7da69275d37e7a2b8509effd2c3a) --- .../app/ceph/block/rbd-list/rbd-list.component.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts index 10230035d29..1c1d79eba00 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts @@ -214,14 +214,22 @@ export class RbdListComponent extends ListWithDetails implements OnInit { icon: Icons.edit, click: () => this.actionPrimary(true), name: this.actionLabels.PROMOTE, - visible: () => this.selection.first() != null && !this.selection.first().primary + visible: () => this.selection.first() != null && !this.selection.first().primary, + disable: () => + this.selection.first().mirror_mode === 'Disabled' + ? 'Mirroring needs to be enabled on the image to perform this action' + : '' }; const demoteAction: CdTableAction = { permission: 'update', icon: Icons.edit, click: () => this.actionPrimary(false), name: this.actionLabels.DEMOTE, - visible: () => this.selection.first() != null && this.selection.first().primary + visible: () => this.selection.first() != null && this.selection.first().primary, + disable: () => + this.selection.first().mirror_mode === 'Disabled' + ? 'Mirroring needs to be enabled on the image to perform this action' + : '' }; this.tableActions = [ addAction, -- 2.39.5