[pve-devel] [PATCH manager v2 2/2] Fix #1372: require manually entering the Ceph Pool id before destroying a pool
Emmanuel Kasper
e.kasper at proxmox.com
Mon Jun 12 16:18:09 CEST 2017
---
www/manager6/ceph/Pool.js | 23 +++++++----------------
1 file changed, 7 insertions(+), 16 deletions(-)
diff --git a/www/manager6/ceph/Pool.js b/www/manager6/ceph/Pool.js
index df43be44..dff6ecc4 100644
--- a/www/manager6/ceph/Pool.js
+++ b/www/manager6/ceph/Pool.js
@@ -162,32 +162,23 @@ Ext.define('PVE.node.CephPoolList', {
}
});
- var remove_btn = new PVE.button.Button({
+ var remove_btn = Ext.create('PVE.button.Button', {
text: gettext('Remove'),
selModel: sm,
disabled: true,
- confirmMsg: function(rec) {
- var msg = Ext.String.format(gettext('Are you sure you want to remove entry {0}'),
- "'" + rec.data.pool_name + "'");
- msg += " " + gettext('This will permanently erase all data.');
-
- return msg;
- },
handler: function() {
var rec = sm.getSelection()[0];
if (!rec.data.pool_name) {
return;
}
+ var base_url = '/nodes/' + nodename + '/ceph/pools/' +
+ rec.data.pool_name;
- PVE.Utils.API2Request({
- url: "/nodes/" + nodename + "/ceph/pools/" +
- rec.data.pool_name,
- method: 'DELETE',
- failure: function(response, opts) {
- Ext.Msg.alert(gettext('Error'), response.htmlStatus);
- }
- });
+ Ext.create('PVE.window.SafeDestroy', {
+ url: base_url,
+ item: { type: 'CephPool', id: rec.data.pool_name }
+ }).show();
}
});
--
2.11.0
More information about the pve-devel
mailing list