]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: NVme- Delete Subsystem 66771/head
authorpujaoshahu <pshahu@redhat.com>
Thu, 1 Jan 2026 09:51:32 +0000 (15:21 +0530)
committerpujaoshahu <pshahu@redhat.com>
Wed, 28 Jan 2026 07:03:37 +0000 (12:33 +0530)
Fixes: https://tracker.ceph.com/issues/74296
Signed-off-by:pujaoshahu <pshahu@redhat.com>
Signed-off-by: pujaoshahu <pshahu@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-gateway-group/nvmeof-gateway-group.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/nvmeof-subsystems/nvmeof-subsystems.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/delete-confirmation-modal/delete-confirmation-modal.component.html

index b17aa751ce5551708d6877981836e9b44cbdfac0..b1e5e6c6eb9c8ec07f965ba751783ef3fb89b9f1 100644 (file)
@@ -182,7 +182,8 @@ export class NvmeofGatewayGroupComponent implements OnInit {
       itemNames: [selectedGroup.spec.group],
       bodyContext: {
         disableForm,
-        subsystemCount: selectedGroup.subSystemCount
+        subsystemCount: selectedGroup.subSystemCount,
+        deletionMessage: $localize`Deleting <strong>${selectedGroup.spec.group}</strong> will remove all associated subsystems and may disrupt traffic routing for services relying on it. This action cannot be undone.`
       },
       submitActionObservable: () => {
         return this.taskWrapper
index dc29124710205489740cf90e8cf872c1f73a8fb6..d7a3f3f2c5b3009c50a8f6ce094f1e98994f6e5c 100644 (file)
@@ -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<any>;
 
+  @ViewChild('deleteTpl', { static: true })
+  deleteTpl: TemplateRef<any>;
+
   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 <strong>${subsystem.nqn}</strong> 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;
index 20541a41536f73d5c900afb58a31b408488d6489..dde49ee5151ccddafa3d4f6f3ba23eedd4a429f5 100644 (file)
                           i18n>Yes, I am sure.</cds-checkbox>
           </ng-container>
           <ng-template #highImpactDeletion>
-            <p i18n
-               class="cds--type-body-01">
-              Deleting <strong>{{ itemNames[0] }}</strong> will remove all associated {{itemDescription}} and may disrupt traffic routing for
-              services relying on it. This action cannot be undone.
+            <p class="cds--type-body-01">
+            @if (bodyContext?.deletionMessage) {
+            <span [innerHTML]="bodyContext.deletionMessage"></span>
+            } @else {
+            <ng-container i18n>Deleting <strong>{{ itemNames[0] }}</strong> will remove all associated {{itemDescription}}.This action cannot be undone.</ng-container>
+            }
             </p>
             <ng-template #labelTemplate>
               <span i18n>Type <strong>{{ itemNames[0] }}</strong> to confirm (required)</span>