From: Ricardo Marques Date: Tue, 1 Oct 2019 11:19:42 +0000 (+0100) Subject: mgr/dashboard: Provide the name of the object being deleted X-Git-Tag: v14.2.5~24^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5b6554edc79d1c0738e1e25da81d661fc99dfe51;p=ceph.git mgr/dashboard: Provide the name of the object being deleted Fixes: https://tracker.ceph.com/issues/41687 Signed-off-by: Ricardo Marques (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. --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.ts index c1f66967f9b..49067d7d942 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.ts @@ -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', { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.ts index b4666d71ed6..98d4f48b250 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.ts @@ -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) => { this.taskWrapper diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts index 0ba72c8ef67..c86b1524bd3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts @@ -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', { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts index 101525bf30b..d68057862bf 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts @@ -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) } }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.ts index 71f32dbeb28..27a2e4a20d6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.ts @@ -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: () => diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts index 9c8360eb7b0..4cab7463a53 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.ts @@ -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) => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts index 2a52098923e..6e69c7d395b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts @@ -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', { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts index 7e944fc3e1e..baf13ae7999 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts @@ -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 }), diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts index e8dd9fdc004..dd75d06467f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts @@ -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 }), diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts index 3923071d7a4..bfdcd046797 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts @@ -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) => { // Delete all selected data table rows. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.ts index 7a6789f4b89..eb3b98d5de6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-list/rgw-user-list.component.ts @@ -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 => { return new Observable((observer: Subscriber) => { // Delete all selected data table rows. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.ts index 49b9c2ac468..569e1fdd21a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.ts @@ -130,6 +130,7 @@ export class RoleListComponent implements OnInit { this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, { initialState: { itemDescription: 'Role', + itemNames: [name], submitAction: () => this.deleteRole(name) } }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts index 060b9a90a20..77962d428ce 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.ts @@ -137,6 +137,7 @@ export class UserListComponent implements OnInit { this.modalRef = this.modalService.show(CriticalConfirmationModalComponent, { initialState: { itemDescription: 'User', + itemNames: [username], submitAction: () => this.deleteUser(username) } }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.html b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.html index 7f0d3d786ea..c6c9304551c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.html @@ -12,7 +12,19 @@