From 1efd37d4b5fc4363c6c86a84ede9c826c94d2c22 Mon Sep 17 00:00:00 2001 From: Nizamudeen A Date: Wed, 17 Sep 2025 09:09:54 +0530 Subject: [PATCH] mgr/dashboard: fix rbd form mirroring toggle - fix the toggle not working while editing the image - the rbd form mirroring toggle doesn't disable/enable the mirror mode when you change the pool. - also re-arrange the form in a way that the required fields are together. - disable mirroring when selecting the namespace Fixes: https://tracker.ceph.com/issues/72458 Signed-off-by: Nizamudeen A --- .../src/app/ceph/block/rbd-contants.ts | 10 ++ .../block/rbd-form/rbd-form.component.html | 151 ++++++++++-------- .../ceph/block/rbd-form/rbd-form.component.ts | 23 ++- 3 files changed, 113 insertions(+), 71 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-contants.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-contants.ts index c5b251915946f..abc78f7612dcb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-contants.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-contants.ts @@ -12,3 +12,13 @@ export const RBDActionHelpers = { journalTooltipText: $localize`'Ensures reliable replication by logging changes before updating the image, but doubles write time, impacting performance. Not recommended for high-speed data processing tasks.`, snapshotTooltipText: $localize`This mode replicates RBD images between clusters using snapshots, efficiently copying data changes but requiring complete delta syncing during failover. Ideal for less demanding tasks due to its less granular approach compared to journaling.` }; + +export const RBDPoolMirrorModes = { + pool: 'pool', + image: 'image' +} + +export const RBDMirroringModes = { + journal: 'journal', + snapshot: 'snapshot' +} diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html index a6675bc0898d2..225c52510814a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.html @@ -75,6 +75,7 @@ cdRequiredField="Pool" [invalid]="!rbdForm.controls['pool'].valid && (rbdForm.controls['pool'].dirty)" [invalidText]="poolError" + (valueChange)="setPoolMirrorMode()" *ngIf="mode !== 'editing' && poolPermission.read">