[pve-devel] [PATCH manager 5/6] gui: ceph: add a ceph flag EditWindow

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


this simply shows a grid with the available flags of the backend,
with a checkbox indicating the status

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

diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index 7e197c90..476e08d9 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -163,6 +163,84 @@ Ext.define('PVE.CephRemoveOsd', {
     }
 });
 
+Ext.define('PVE.CephSetFlags', {
+    extend: 'Proxmox.window.Edit',
+    xtype: 'pveCephSetFlags',
+
+    subject: gettext('Ceph Flags'),
+
+    showProgress: true,
+
+    width: 600,
+    onlineHelp: 'pve_ceph_osds',
+    isCreate: true,
+    submitText: gettext('Set Flags'),
+
+    items: [
+	{
+	    xtype: 'inputpanel',
+	    onGetValues: function(values) {
+		var me = this;
+		var val = {};
+		var data = me.down('#flaggrid').getStore().each((rec) => {
+		    val[rec.data.name] = rec.data.value ? 1 : 0;
+		});
+
+		return val;
+	    },
+	    items: [
+		{
+		    xtype: 'grid',
+		    itemId: 'flaggrid',
+		    store: {},
+
+		    columns: [
+			{
+			    text: gettext('Enable'),
+			    xtype: 'checkcolumn',
+			    width: 60,
+			    dataIndex: 'value',
+			},
+			{
+			    text: 'Name',
+			    dataIndex: 'name',
+			},
+			{
+			    text: 'Description',
+			    flex: 1,
+			    dataIndex: 'description',
+			},
+		    ]
+		}
+	    ],
+	},
+    ],
+
+    initComponent : function() {
+        var me = this;
+
+	if (!me.nodename) {
+	    throw "no node name specified";
+	}
+
+        Ext.applyIf(me, {
+	    url: "/nodes/" + me.nodename + "/ceph/allflags",
+	    method: 'PUT',
+	});
+
+	me.callParent();
+	var grid = me.down('#flaggrid');
+	me.load({
+	    success: function(response, options) {
+		var data = response.result.data;
+		grid.getStore().setData(data);
+		// set the put url correctly
+		me.url = "/nodes/" + me.nodename + "/ceph/flags";
+	    }
+	})
+    }
+});
+
 Ext.define('PVE.node.CephOsdTree', {
     extend: 'Ext.tree.Panel',
     alias: ['widget.pveNodeCephOsdTree'],
-- 
2.20.1





More information about the pve-devel mailing list