From 2a5c73f1e8a6d4a1f9ac3764782c5adfbaab62ab Mon Sep 17 00:00:00 2001 From: Dnyaneshwari Date: Thu, 16 Oct 2025 09:46:16 +0530 Subject: [PATCH] mgr/dashboard: Carbonize Administration module > Create Realm/Zone group/Zone Fixes: https://tracker.ceph.com/issues/73544 Signed-off-by: Dnyaneshwari Talwekar --- .../service-form/service-form.component.ts | 18 +- ...create-rgw-service-entities.component.html | 175 +++++++++++------- .../create-rgw-service-entities.component.ts | 22 ++- .../src/app/ceph/rgw/models/rgw-multisite.ts | 6 + 4 files changed, 141 insertions(+), 80 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts index e1228f5ef90ac..185a9a99e5244 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts @@ -3,14 +3,14 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core'; import { AbstractControl, UntypedFormControl, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; -import { NgbActiveModal, NgbModalRef, NgbTypeahead } from '@ng-bootstrap/ng-bootstrap'; +import { NgbActiveModal, NgbTypeahead } from '@ng-bootstrap/ng-bootstrap'; import { ListItem } from 'carbon-components-angular'; import _ from 'lodash'; import { forkJoin, merge, Observable, Subject, Subscription } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter, map } from 'rxjs/operators'; import { Pool } from '~/app/ceph/pool/pool'; import { CreateRgwServiceEntitiesComponent } from '~/app/ceph/rgw/create-rgw-service-entities/create-rgw-service-entities.component'; -import { RgwRealm, RgwZonegroup, RgwZone } from '~/app/ceph/rgw/models/rgw-multisite'; +import { RgwRealm, RgwZonegroup, RgwZone, RgwEntities } from '~/app/ceph/rgw/models/rgw-multisite'; import { CephServiceService } from '~/app/shared/api/ceph-service.service'; import { HostService } from '~/app/shared/api/host.service'; @@ -36,7 +36,7 @@ import { CdValidators } from '~/app/shared/forms/cd-validators'; import { FinishedTask } from '~/app/shared/models/finished-task'; import { Host } from '~/app/shared/models/host.interface'; import { CephServiceSpec } from '~/app/shared/models/service.interface'; -import { ModalService } from '~/app/shared/services/modal.service'; +import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; import { TaskWrapperService } from '~/app/shared/services/task-wrapper.service'; import { TimerService } from '~/app/shared/services/timer.service'; @@ -88,7 +88,6 @@ export class ServiceFormComponent extends CdForm implements OnInit { realmList: RgwRealm[] = []; zonegroupList: RgwZonegroup[] = []; zoneList: RgwZone[] = []; - bsModalRef: NgbModalRef; defaultZonegroup: RgwZonegroup; showRealmCreationForm = false; defaultsInfo: { defaultRealmName: string; defaultZonegroupName: string; defaultZoneName: string }; @@ -125,7 +124,7 @@ export class ServiceFormComponent extends CdForm implements OnInit { public rgwMultisiteService: RgwMultisiteService, private route: ActivatedRoute, public activeModal: NgbActiveModal, - public modalService: ModalService + public modalService: ModalCdsService ) { super(); this.resource = $localize`service`; @@ -1364,11 +1363,10 @@ export class ServiceFormComponent extends CdForm implements OnInit { } createMultisiteSetup() { - this.bsModalRef = this.modalService.show(CreateRgwServiceEntitiesComponent, { - size: 'lg' - }); - this.bsModalRef.componentInstance.submitAction.subscribe(() => { - this.setRgwFields(); + const modalRef = this.modalService.show(CreateRgwServiceEntitiesComponent); + const modalComponent = modalRef as CreateRgwServiceEntitiesComponent; + modalComponent.submitAction.subscribe((item: RgwEntities) => { + this.setRgwFields(item.realm_name, item.zonegroup_name, item.zone_name); }); } } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/create-rgw-service-entities/create-rgw-service-entities.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/create-rgw-service-entities/create-rgw-service-entities.component.html index 140f314ce5379..36c31b4a93ec7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/create-rgw-service-entities/create-rgw-service-entities.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/create-rgw-service-entities/create-rgw-service-entities.component.html @@ -1,70 +1,117 @@ - - Create Realm/Zone Group/Zone - - - -
-