From 67c525e3b872057b77a317340ace9e4ca7a757d2 Mon Sep 17 00:00:00 2001 From: pujaoshahu Date: Thu, 1 Jan 2026 15:21:32 +0530 Subject: [PATCH] mgr/dashboard: NVme- Delete Subsystem Fixes: https://tracker.ceph.com/issues/74296 Signed-off-by:pujaoshahu Signed-off-by: pujaoshahu --- .../nvmeof-gateway-group.component.ts | 3 ++- .../nvmeof-subsystems.component.ts | 15 ++++++++++++--- .../delete-confirmation-modal.component.html | 10 ++++++---- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-group/nvmeof-gateway-group.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-group/nvmeof-gateway-group.component.ts index b17aa751ce5..b1e5e6c6eb9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-group/nvmeof-gateway-group.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-group/nvmeof-gateway-group.component.ts @@ -182,7 +182,8 @@ export class NvmeofGatewayGroupComponent implements OnInit { itemNames: [selectedGroup.spec.group], bodyContext: { disableForm, - subsystemCount: selectedGroup.subSystemCount + subsystemCount: selectedGroup.subSystemCount, + deletionMessage: $localize`Deleting ${selectedGroup.spec.group} will remove all associated subsystems and may disrupt traffic routing for services relying on it. This action cannot be undone.` }, submitActionObservable: () => { return this.taskWrapper diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts index dc291247102..d7a3f3f2c5b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts @@ -20,6 +20,7 @@ import { ModalCdsService } from '~/app/shared/services/modal-cds.service'; import { CephServiceSpec } from '~/app/shared/models/service.interface'; import { forkJoin, of, Subject } from 'rxjs'; import { catchError, map, switchMap, takeUntil } from 'rxjs/operators'; +import { DeletionImpact } from '~/app/shared/enum/delete-confirmation-modal-impact.enum'; const BASE_URL = 'block/nvmeof/subsystems'; const DEFAULT_PLACEHOLDER = $localize`Enter group name`; @@ -37,6 +38,9 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit @ViewChild('encryptionTpl', { static: true }) encryptionTpl: TemplateRef; + @ViewChild('deleteTpl', { static: true }) + deleteTpl: TemplateRef; + subsystems: (NvmeofSubsystem & { gw_group?: string; initiator_count?: number })[] = []; subsystemsColumns: any; permissions: Permissions; @@ -56,9 +60,9 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit private authStorageService: AuthStorageService, public actionLabels: ActionLabelsI18n, private router: Router, + private route: ActivatedRoute, private modalService: ModalCdsService, private taskWrapper: TaskWrapperService, - private route: ActivatedRoute, private notificationService: NotificationService ) { super(); @@ -100,6 +104,7 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit cellTemplate: this.encryptionTpl } ]; + this.tableActions = [ { name: this.actionLabels.CREATE, @@ -160,9 +165,14 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit deleteSubsystemModal() { const subsystem = this.selection.first(); this.modalService.show(DeleteConfirmationModalComponent, { - itemDescription: 'Subsystem', + itemDescription: $localize`Subsystem`, + impact: DeletionImpact.high, + bodyTemplate: this.deleteTpl, itemNames: [subsystem.nqn], actionDescription: 'delete', + bodyContext: { + deletionMessage: $localize`Deleting ${subsystem.nqn} will remove all associated configurations and resources. Dependent services may stop working. This action cannot be undone.` + }, submitActionObservable: () => this.taskWrapper.wrapTaskAroundCall({ task: new FinishedTask('nvmeof/subsystem/delete', { nqn: subsystem.nqn }), @@ -171,7 +181,6 @@ export class NvmeofSubsystemsComponent extends ListWithDetails implements OnInit }); } - // Gateway groups onGroupSelection(selected: GroupsComboboxItem) { selected.selected = true; this.group = selected.content; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/delete-confirmation-modal/delete-confirmation-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/delete-confirmation-modal/delete-confirmation-modal.component.html index 20541a41536..dde49ee5151 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/delete-confirmation-modal/delete-confirmation-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/delete-confirmation-modal/delete-confirmation-modal.component.html @@ -46,10 +46,12 @@ i18n>Yes, I am sure. -

- Deleting {{ itemNames[0] }} will remove all associated {{itemDescription}} and may disrupt traffic routing for - services relying on it. This action cannot be undone. +

+ @if (bodyContext?.deletionMessage) { + + } @else { + Deleting {{ itemNames[0] }} will remove all associated {{itemDescription}}.This action cannot be undone. + }

Type {{ itemNames[0] }} to confirm (required) -- 2.47.3