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: v15.1.0~1279^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=299fc757e0bb8127b8cfb24ba752d8096f84ef72;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 --- 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 7a06de5a023e..13ca22d26637 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 @@ -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', { 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 5129b8f83f95..3b140e07b43c 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 @@ -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) => { 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 761260325463..b15d140b85a8 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 @@ -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', { 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 b77a69444567..1f2a9b15a9b8 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 @@ -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) } }); 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 fefebbebaffb..38b2d478c923 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 @@ -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: () => diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-clients/cephfs-clients.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-clients/cephfs-clients.component.ts index f0dae82f06ef..327a4e1245bc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-clients/cephfs-clients.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-clients/cephfs-clients.component.ts @@ -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) } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts index 1767c7be76ef..f22f4c6b59d0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts @@ -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({ 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 2671a1d46c58..50542a5a5cee 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 @@ -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) => { 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 9c9b7a9fe757..ea5740f1c987 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 @@ -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', { 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 e8a09a0d0547..85273c4a460b 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 @@ -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 }), 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 847cf0375198..6dee9e1baa58 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 @@ -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 }), 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 6b5b60216788..02065b5ddeca 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 @@ -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) => { // 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 b02a741f193f..be0c6377f888 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 @@ -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 => { 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 7c3e59981506..9f5efd5a0dff 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 @@ -131,6 +131,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 658ccbab4c9d..8b1f1127e076 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 @@ -147,6 +147,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 de8b23ce9b9a..3e2a2663b158 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,8 +12,19 @@