[pve-devel] [PATCH manager 6/6] gui: ceph: convert 'set noout' button to 'set flags'

Dominik Csapak d.csapak at proxmox.com
Mon Jul 22 16:08:52 CEST 2019


by using the new CephSetFlags EditWindow

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/ceph/OSD.js | 23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index 476e08d9..d86b7089 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -310,8 +310,6 @@ Ext.define('PVE.node.CephOsdTree', {
 
 		    var flags = data.flags.split(',');
 		    vm.set('flags', flags);
-		    var noout = flags.includes('noout');
-		    me.down('#nooutBtn').setText(noout ? gettext("Unset noout") : gettext("Set noout"));
 		}
 	    });
 	},
@@ -377,19 +375,13 @@ Ext.define('PVE.node.CephOsdTree', {
 	    }).show();
 	},
 
-	set_flag: function() {
+	set_flags: function() {
 	    var me = this;
 	    var vm = this.getViewModel();
-	    var flags = vm.get('flags');
-	    Proxmox.Utils.API2Request({
-		url: "/nodes/" + vm.get('nodename') + "/ceph/flags/noout",
-		waitMsgTarget: me.getView(),
-		method: flags.includes('noout') ? 'DELETE' : 'POST',
-		failure: function(response, opts) {
-		    Ext.Msg.alert(gettext('Error'), response.htmlStatus);
-		},
-		success: () => { me.reload(); }
-	    });
+	    Ext.create('PVE.CephSetFlags', {
+		nodename: vm.get('nodename'),
+		taskDone: () => { me.reload(); }
+	    }).show();
 	},
 
 	service_cmd: function(comp) {
@@ -641,9 +633,8 @@ Ext.define('PVE.node.CephOsdTree', {
 		handler: 'create_osd',
 	    },
 	    {
-		text: gettext('Set noout'),
-		itemId: 'nooutBtn',
-		handler: 'set_flag',
+		text: gettext('Set Flags'),
+		handler: 'set_flags',
 	    },
 	    '->',
 	    {
-- 
2.20.1





More information about the pve-devel mailing list