]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Provide the name of the object being deleted 31263/head
authorRicardo Marques <rimarques@suse.com>
Tue, 1 Oct 2019 11:19:42 +0000 (12:19 +0100)
committerRicardo Marques <rimarques@suse.com>
Tue, 12 Nov 2019 16:58:04 +0000 (16:58 +0000)
Fixes: https://tracker.ceph.com/issues/41687
Signed-off-by: Ricardo Marques <rimarques@suse.com>
(cherry picked from commit 299fc757e0bb8127b8cfb24ba752d8096f84ef72)

 Conflicts:
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/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

Conflicts caused by "Master" using Bootstrap 4, but "Nautilus" using Bootstap 3.

16 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/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 c1f66967f9b56c7573c386927bfcfd4fb3075693..49067d7d942a812ed7b6bb64b5e5f998ab5a77a7 100644 (file)
@@ -171,7 +171,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 b4666d71ed6a9165bd2f3ad1dc749807bc6072db..98d4f48b25092f40c3fc6766bdfb282fd456b75e 100644 (file)
@@ -134,6 +134,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 0ba72c8ef67973f7eef178fb1892f0c4fae3b2c8..c86b1524bd3a658b979555faae762c30bd4565b8 100644 (file)
@@ -288,6 +288,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 101525bf30b552f24922479251ff06dc2bb3e1b3..d68057862bf3977d81c22015fec720c77ec4da62 100644 (file)
@@ -272,6 +272,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 71f32dbeb284505a57589e2190973d9283610ada..27a2e4a20d6634e6d23de47422f3e48dc845463c 100644 (file)
@@ -182,6 +182,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 9c8360eb7b0a9aa46255026254b9e69e197c6680..4cab7463a53914f2cb0fca735bd0d6763939a363 100644 (file)
@@ -168,6 +168,7 @@ export class SilenceListComponent implements OnInit {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: i18nSilence,
+        itemNames: [id],
         actionDescription: this.actionLabels.EXPIRE,
         submitActionObservable: () =>
           new Observable((observer: Subscriber<any>) => {
index 2a52098923e092d9c04ad6d35c5e796e3bde4af5..6e69c7d395bd32d8701963fa7a8f654589519de0 100644 (file)
@@ -198,7 +198,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 7e944fc3e1ef92d45cd70078a544c978fd8d1e47..baf13ae799943061fff6c944e42f89fda50f2db0 100644 (file)
@@ -506,6 +506,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 e8dd9fdc0042603e5f5e1abc742aac6a4bd9291f..dd75d06467f8606d67a23bce3c32389d821a0b61 100644 (file)
@@ -217,6 +217,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 3923071d7a46e75b05f067d349f39fde6ae333b8..bfdcd04679773647f899aff37d5b0fb9af843fe1 100644 (file)
@@ -99,6 +99,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 7a6789f4b896e45547be0c8dacfc6d2f8385a578..eb3b98d5de69fb94c2ed4da11b56ec2e0d92ca76 100644 (file)
@@ -115,6 +115,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 49b9c2ac468c5e4d9a094425f51c92593dee9f47..569e1fdd21a1c70cf87192f84b00ee6a2cb482b3 100644 (file)
@@ -130,6 +130,7 @@ export class RoleListComponent implements OnInit {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: 'Role',
+        itemNames: [name],
         submitAction: () => this.deleteRole(name)
       }
     });
index 060b9a90a200e85a71bae40b963ed2a75d8a8f88..77962d428ce5b576b62f7ab44069f75d91d9b2bc 100644 (file)
@@ -137,6 +137,7 @@ export class UserListComponent implements OnInit {
     this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, {
       initialState: {
         itemDescription: 'User',
+        itemNames: [username],
         submitAction: () => this.deleteUser(username)
       }
     });
index 7f0d3d786ea3c5890105cd47e5b81e5643b34df8..c6c9304551c307d220a9e91ed73f11cecfa3a0cd 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"
                [ngClass]="{'has-error': deletionForm.showError('confirmation', formDir)}">
             <div class="checkbox checkbox-primary">
index a721bcae5fcd99d856bf867f4255179d847fee99..5c1f14057a29a8606f1975dfa539be36727da77b 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) {}