From 1be7446ada23c477cb272e8e4de119553ff81c04 Mon Sep 17 00:00:00 2001 From: Dnyaneshwari Date: Tue, 4 Nov 2025 10:15:02 +0530 Subject: [PATCH] mgr/dashboard: Carbonize - Multisite Zone Fixes: https://tracker.ceph.com/issues/73707 Signed-off-by: Dnyaneshwari Talwekar --- .../rgw-multisite-details.component.ts | 16 +- .../rgw-multisite-zone-form.component.html | 547 +++++++++--------- .../rgw-multisite-zone-form.component.scss | 4 + .../rgw-multisite-zone-form.component.spec.ts | 70 ++- .../rgw-multisite-zone-form.component.ts | 48 +- ...gw-multisite-zonegroup-form.component.html | 20 +- ...multisite-zonegroup-form.component.spec.ts | 13 +- .../rgw-multisite-zonegroup-form.component.ts | 13 +- 8 files changed, 385 insertions(+), 346 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-details/rgw-multisite-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-details/rgw-multisite-details.component.ts index 543dbd7408197..13aed824cd218 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-details/rgw-multisite-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-details/rgw-multisite-details.component.ts @@ -42,6 +42,7 @@ import { RgwMultisiteWizardComponent } from '../rgw-multisite-wizard/rgw-multisi import { RgwMultisiteSyncPolicyComponent } from '../rgw-multisite-sync-policy/rgw-multisite-sync-policy.component'; import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; import { RgwMultisiteService } from '~/app/shared/api/rgw-multisite.service'; +import { CdForm } from '~/app/shared/forms/cd-form'; const BASE_URL = 'rgw/multisite/configuration'; @@ -51,7 +52,7 @@ const BASE_URL = 'rgw/multisite/configuration'; styleUrls: ['./rgw-multisite-details.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) -export class RgwMultisiteDetailsComponent implements OnDestroy, OnInit { +export class RgwMultisiteDetailsComponent extends CdForm implements OnDestroy, OnInit { private sub = new Subscription(); @ViewChild('treeNodeTemplate') labelTpl: TemplateRef; @ViewChild(RgwMultisiteSyncPolicyComponent) syncPolicyComp: RgwMultisiteSyncPolicyComponent; @@ -140,12 +141,13 @@ export class RgwMultisiteDetailsComponent implements OnDestroy, OnInit { private rgwMultisiteService: RgwMultisiteService, private changeDetectionRef: ChangeDetectorRef ) { + super(); this.permissions = this.authStorageService.getPermissions(); } openModal(entity: any | string, edit = false) { const entityName = edit ? entity?.data?.type : entity; - const action = edit ? 'edit' : 'create'; + const action = edit ? this.actionLabels.EDIT : this.actionLabels.CREATE; const initialState = { resource: entityName, action: action, @@ -154,14 +156,18 @@ export class RgwMultisiteDetailsComponent implements OnDestroy, OnInit { multisiteInfo: this.multisiteInfo }; if (entityName === 'realm') { - this.bsModalRef = this.cdsModalService.show(RgwMultisiteRealmFormComponent, initialState); + this.cdsModalService.show(RgwMultisiteRealmFormComponent, initialState); } else if (entityName === 'zonegroup') { this.bsModalRef = this.modalService.show(RgwMultisiteZonegroupFormComponent, initialState, { size: 'lg' }); } else { - this.bsModalRef = this.modalService.show(RgwMultisiteZoneFormComponent, initialState, { - size: 'lg' + this.cdsModalService.show(RgwMultisiteZoneFormComponent, { + resource: entityName, + action: action, + info: entity, + defaultsInfo: this.defaultsInfo, + multisiteInfo: this.multisiteInfo }); } } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-zone-form/rgw-multisite-zone-form.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-zone-form/rgw-multisite-zone-form.component.html index f2b8cf2d5b5ad..a8855e94d5b4b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-zone-form/rgw-multisite-zone-form.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-zone-form/rgw-multisite-zone-form.component.html @@ -1,295 +1,278 @@ - - {{ action | titlecase }} {{ resource | upperFirst }} - - -
-