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

Dominik Csapak d.csapak at proxmox.com
Tue Jul 23 09:52:29 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 4eca1303..c1463485 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -334,8 +334,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"));
 		}
 	    });
 	},
@@ -401,19 +399,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) {
@@ -668,9 +660,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