[pve-devel] [PATCH manager] gui: ceph configdb: fix store load

Dominik Csapak d.csapak at proxmox.com
Thu Jul 11 14:52:38 CEST 2019


instead of using API2Request, use the proper grid store load

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

diff --git a/www/manager6/ceph/Config.js b/www/manager6/ceph/Config.js
index 21b3c776..790f04c2 100644
--- a/www/manager6/ceph/Config.js
+++ b/www/manager6/ceph/Config.js
@@ -3,20 +3,10 @@ Ext.define('PVE.node.CephConfigDb', {
     alias: 'widget.pveNodeCephConfigDb',
 
     border: false,
-    load: function() {
-	var me = this;
-
-	Proxmox.Utils.API2Request({
-	    url: me.url,
-	    waitMsgTarget: me,
-	    failure: function(response, opts) {
-		console.log(response);
-	    },
-	    success: function(response, opts) {
-		var data = response.result.data;
-		me.getStore().setData(data);
-	    }
-	});
+    store: {
+	proxy: {
+	    type: 'proxmox'
+	}
     },
 
     columns: [
@@ -63,18 +53,12 @@ Ext.define('PVE.node.CephConfigDb', {
 	    throw "no node name specified";
 	}
 
-	Ext.apply(me, {
-	    url: '/nodes/' + nodename + '/ceph/configdb',
-	    listeners: {
-		activate: function() {
-		    me.load();
-		}
-	    }
-	});
+	me.store.proxy.url = '/api2/json/nodes/' + nodename + '/ceph/configdb';
 
 	me.callParent();
 
-	me.load();
+	Proxmox.Utils.monStoreErrors(me, me.getStore());
+	me.getStore().load();
     }
 });
 Ext.define('PVE.node.CephConfig', {
-- 
2.20.1





More information about the pve-devel mailing list