]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Provide the name of the object being deleted 30658/head
authorRicardo Marques <rimarques@suse.com>
Tue, 1 Oct 2019 11:19:42 +0000 (12:19 +0100)
committerRicardo Marques <rimarques@suse.com>
Fri, 4 Oct 2019 22:59:10 +0000 (23:59 +0100)
Fixes: https://tracker.ceph.com/issues/41687
Signed-off-by: Ricardo Marques <rimarques@suse.com>
18 files changed:
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-clients/cephfs-clients.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.html
src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.scss
src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.ts

index 7a06de5a023ef8d61d2a504dda81909db8873df6..13ca22d266377e37bd0dc96c31fc0225699a349d 100644 (file)
@@ -189,7 +189,8 @@ export class IscsiTargetListComponent implements OnInit, OnDestroy {
 
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
-        itemDescription: this.i18n('iSCSI'),
+        itemDescription: this.i18n('iSCSI target'),
+        itemNames: [target_iqn],
         submitActionObservable: () =>
           this.taskWrapper.wrapTaskAroundCall({
             task: new FinishedTask('iscsi/target/delete', {
index 5129b8f83f95eeb6d0969c0b7e29ae4a3346bfcf..3b140e07b43c75a019abdf7e753b7547fd99b19d 100644 (file)
@@ -135,6 +135,7 @@ export class PoolListComponent implements OnInit, OnDestroy {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: this.i18n('mirror peer'),
+        itemNames: [`${poolName} (${peerUUID})`],
         submitActionObservable: () =>
           new Observable((observer: Subscriber<any>) => {
             this.taskWrapper
index 7612603254633a12671c0c11aa181e5e9299e2e6..b15d140b85a86f527b42d517c5522eb56edc378f 100644 (file)
@@ -291,6 +291,7 @@ export class RbdListComponent implements OnInit {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: 'RBD',
+        itemNames: [`${poolName}/${imageName}`],
         submitActionObservable: () =>
           this.taskWrapper.wrapTaskAroundCall({
             task: new FinishedTask('rbd/delete', {
index b77a69444567bf174133e0b769ba85bf43bff674..1f2a9b15a9b8b1cd78dc465d9653663b458b5dd7 100644 (file)
@@ -277,6 +277,7 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: this.i18n('RBD snapshot'),
+        itemNames: [snapshotName],
         submitAction: () => this._asyncTask('deleteSnapshot', 'rbd/snap/delete', snapshotName)
       }
     });
index fefebbebaffb30ad56d54550571122c383e96a15..38b2d478c923130ae847e0a904a9c291466ccac1 100644 (file)
@@ -186,6 +186,7 @@ export class RbdTrashListComponent implements OnInit {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: 'RBD',
+        itemNames: [`${poolName}/${imageName}`],
         bodyTemplate: this.deleteTpl,
         bodyContext: { $implicit: expiresAt },
         submitActionObservable: () =>
index f0dae82f06efeabca1f24082f3000a365117e48a..327a4e1245bc21dbbce00ae9406241c32c5a2efe 100644 (file)
@@ -96,6 +96,7 @@ export class CephfsClientsComponent implements OnInit {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: 'client',
+        itemNames: [clientId],
         actionDescription: 'evict',
         submitAction: () => this.evictClient(clientId)
       }
index 1767c7be76efda86f5d5a89905ac65720acc3483..f22f4c6b59d0debbd11f4020d3f8105523739a12 100644 (file)
@@ -108,6 +108,7 @@ export class HostsComponent implements OnInit {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: 'Host',
+        itemNames: [hostname],
         actionDescription: 'remove',
         submitActionObservable: () =>
           this.taskWrapper.wrapTaskAroundCall({
index 2671a1d46c58cac41584fc08b0e8896a29e5a1cf..50542a5a5cee7b3b3ca21b031c4edf8bc66c8df1 100644 (file)
@@ -165,6 +165,7 @@ export class SilenceListComponent {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: i18nSilence,
+        itemNames: [id],
         actionDescription: this.actionLabels.EXPIRE,
         submitActionObservable: () =>
           new Observable((observer: Subscriber<any>) => {
index 9c9b7a9fe757d82b2cc11a50beb7e7da250e7531..ea5740f1c9876f66d3e17a67e7dd2be44e5c815e 100644 (file)
@@ -206,7 +206,8 @@ export class NfsListComponent implements OnInit, OnDestroy {
 
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
-        itemDescription: this.i18n('NFS'),
+        itemDescription: this.i18n('NFS export'),
+        itemNames: [`${cluster_id}:${export_id}`],
         submitActionObservable: () =>
           this.taskWrapper.wrapTaskAroundCall({
             task: new FinishedTask('nfs/delete', {
index e8a09a0d0547a95616f7a2e147e74d1c7a4ee215..85273c4a460b3350225e8b8829ee34b42882cad3 100644 (file)
@@ -511,6 +511,7 @@ export class PoolFormComponent implements OnInit {
     this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: this.i18n('erasure code profile'),
+        itemNames: [name],
         submitActionObservable: () =>
           this.taskWrapper.wrapTaskAroundCall({
             task: new FinishedTask('ecp/delete', { name: name }),
index 847cf03751980c1906851cfc0aaaf511cad39279..6dee9e1baa588821ea593b3a3ebd8033149fbfbb 100644 (file)
@@ -222,6 +222,7 @@ export class PoolListComponent implements OnInit {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: 'Pool',
+        itemNames: [name],
         submitActionObservable: () =>
           this.taskWrapper.wrapTaskAroundCall({
             task: new FinishedTask(`${BASE_URL}/${URLVerbs.DELETE}`, { pool_name: name }),
index 6b5b60216788b51ee82c392d26ae32bc6db9aa0a..02065b5ddeca938c9b2f41f3d2665de31cba12a8 100644 (file)
@@ -100,6 +100,7 @@ export class RgwBucketListComponent {
         itemDescription: this.selection.hasSingleSelection
           ? this.i18n('bucket')
           : this.i18n('buckets'),
+        itemNames: this.selection.selected.map((bucket: any) => bucket['bid']),
         submitActionObservable: () => {
           return new Observable((observer: Subscriber<any>) => {
             // Delete all selected data table rows.
index b02a741f193f390d2321303651abe2b718fe1b10..be0c6377f888a2985753f5b75731e03d44f03288 100644 (file)
@@ -116,6 +116,7 @@ export class RgwUserListComponent {
     this.bsModalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: this.selection.hasSingleSelection ? this.i18n('user') : this.i18n('users'),
+        itemNames: this.selection.selected.map((user: any) => user['uid']),
         submitActionObservable: (): Observable<any> => {
           return new Observable((observer: Subscriber<any>) => {
             // Delete all selected data table rows.
index 7c3e5998150692a2231642bc12498872405bdee1..9f5efd5a0dff1a05d345b86e23620ac57718c6f6 100644 (file)
@@ -131,6 +131,7 @@ export class RoleListComponent implements OnInit {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: 'Role',
+        itemNames: [name],
         submitAction: () => this.deleteRole(name)
       }
     });
index 658ccbab4c9d3bee8430551858007b19125b8fc4..8b1f1127e076d0429c9962ae2762c76d07ca981d 100644 (file)
@@ -147,6 +147,7 @@ export class UserListComponent implements OnInit {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: 'User',
+        itemNames: [username],
         submitAction: () => this.deleteUser(username)
       }
     });
index de8b23ce9b9a0adf95e98278f561855596b0de8c..3e2a2663b158434c6ab29e6779dd677305aabdbf 100644 (file)
       <div class="modal-body">
         <ng-container *ngTemplateOutlet="bodyTemplate; context: bodyContext"></ng-container>
         <div class="question">
-          <p i18n>Are you sure that you want to
-            {{ actionDescription | lowercase }} the selected {{ itemDescription }}?</p>
+          <span *ngIf="itemNames; else noNames">
+            <p *ngIf="itemNames.length === 1; else manyNames"
+               i18n>Are you sure that you want to {{ actionDescription | lowercase }} <strong>{{ itemNames[0] }}</strong>?</p>
+            <ng-template #manyNames>
+              <p i18n>Are you sure that you want to {{ actionDescription | lowercase }} the selected items?</p>
+              <ul>
+                <li *ngFor="let itemName of itemNames"><strong>{{ itemName }}</strong></li>
+              </ul>
+            </ng-template >
+          </span>
+          <ng-template #noNames>
+            <p i18n>Are you sure that you want to {{ actionDescription | lowercase }} the selected {{ itemDescription }}?</p>
+          </ng-template>
           <div class="form-group">
             <div class="custom-control custom-checkbox">
               <input type="checkbox"
index b2aa59f3deb4f41e0409bf1520c4dd44e9d2447f..868c6d6ea42bd98eabb577e954938874f38115e1 100644 (file)
@@ -21,6 +21,7 @@ export class CriticalConfirmationModalComponent implements OnInit {
   submitAction: Function;
   deletionForm: CdFormGroup;
   itemDescription: 'entry';
+  itemNames: string[];
   actionDescription = 'delete';
 
   constructor(public modalRef: BsModalRef) {}