[pve-devel] [RFC manager 22/28] use ObjectStore from widget toolkit

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Dec 11 16:26:11 CET 2017


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 www/manager6/Makefile               |  1 -
 www/manager6/data/ObjectStore.js    | 35 -----------------------------------
 www/manager6/ha/Status.js           |  2 +-
 www/manager6/lxc/Config.js          |  2 +-
 www/manager6/node/Config.js         |  2 +-
 www/manager6/qemu/Config.js         |  2 +-
 www/manager6/storage/ContentView.js |  2 +-
 www/manager6/storage/Summary.js     |  2 +-
 8 files changed, 6 insertions(+), 42 deletions(-)
 delete mode 100644 www/manager6/data/ObjectStore.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index 56183720..89b4667a 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -19,7 +19,6 @@ JSSRC= 				                 	\
 	data/PVEProxy.js				\
 	data/UpdateQueue.js				\
 	data/UpdateStore.js				\
-	data/ObjectStore.js				\
 	data/ResourceStore.js				\
 	data/RRDStore.js				\
 	form/VLanField.js				\
diff --git a/www/manager6/data/ObjectStore.js b/www/manager6/data/ObjectStore.js
deleted file mode 100644
index 6db1e6ce..00000000
--- a/www/manager6/data/ObjectStore.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This store encapsulates data items which are organized as an Array of key-values Objects
- * ie data[0] contains something like {key: "keyboard", value: "da"}
-*
-* Designed to work with the KeyValue model and the JsonObject data reader
-*/
-Ext.define('PVE.data.ObjectStore',  {
-    extend: 'PVE.data.UpdateStore',
-
-    constructor: function(config) {
-	var me = this;
-
-        config = config || {};
-
-	if (!config.storeid) {
-	    config.storeid =  'pve-store-' + (++Ext.idSeed);
-	}
-
-        Ext.applyIf(config, {
-	    model: 'KeyValue',
-            proxy: {
-                type: 'pve',
-		url: config.url,
-		extraParams: config.extraParams,
-                reader: {
-		    type: 'jsonobject',
-		    rows: config.rows,
-		    readArray: config.readArray,
-		    rootProperty: config.root || 'data'
-		}
-            }
-        });
-
-        me.callParent([config]);
-    }
-});
diff --git a/www/manager6/ha/Status.js b/www/manager6/ha/Status.js
index f8418887..915c26e3 100644
--- a/www/manager6/ha/Status.js
+++ b/www/manager6/ha/Status.js
@@ -9,7 +9,7 @@ Ext.define('PVE.ha.Status', {
     initComponent: function() {
 	var me = this;
 
-	me.rstore = Ext.create('PVE.data.ObjectStore', {
+	me.rstore = Ext.create('Proxmox.data.ObjectStore', {
 	    interval: me.interval,
 	    model: 'pve-ha-status',
 	    storeid: 'pve-store-' + (++Ext.idSeed),
diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
index 0ffc4841..58c59962 100644
--- a/www/manager6/lxc/Config.js
+++ b/www/manager6/lxc/Config.js
@@ -25,7 +25,7 @@ Ext.define('PVE.lxc.Config', {
 
 	var base_url = '/nodes/' + nodename + '/lxc/' + vmid;
 
-	me.statusStore = Ext.create('PVE.data.ObjectStore', {
+	me.statusStore = Ext.create('Proxmox.data.ObjectStore', {
 	    url: '/api2/json' + base_url + '/status/current',
 	    interval: 1000
 	});
diff --git a/www/manager6/node/Config.js b/www/manager6/node/Config.js
index 49f1186f..6bdffa44 100644
--- a/www/manager6/node/Config.js
+++ b/www/manager6/node/Config.js
@@ -14,7 +14,7 @@ Ext.define('PVE.node.Config', {
 
 	var caps = Ext.state.Manager.get('GuiCap');
 
-	me.statusStore = Ext.create('PVE.data.ObjectStore', {
+	me.statusStore = Ext.create('Proxmox.data.ObjectStore', {
 	    url: "/api2/json/nodes/" + nodename + "/status",
 	    interval: 1000
 	});
diff --git a/www/manager6/qemu/Config.js b/www/manager6/qemu/Config.js
index db0f3152..3b75b885 100644
--- a/www/manager6/qemu/Config.js
+++ b/www/manager6/qemu/Config.js
@@ -25,7 +25,7 @@ Ext.define('PVE.qemu.Config', {
 
 	var base_url = '/nodes/' + nodename + "/qemu/" + vmid;
 
-	me.statusStore = Ext.create('PVE.data.ObjectStore', {
+	me.statusStore = Ext.create('Proxmox.data.ObjectStore', {
 	    url: '/api2/json' + base_url + '/status/current',
 	    interval: 1000
 	});
diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js
index d5e27f4d..fb4e62f0 100644
--- a/www/manager6/storage/ContentView.js
+++ b/www/manager6/storage/ContentView.js
@@ -401,7 +401,7 @@ Ext.define('PVE.storage.ContentView', {
 	    }
 	});
 
-	me.statusStore = Ext.create('PVE.data.ObjectStore', {
+	me.statusStore = Ext.create('Proxmox.data.ObjectStore', {
 	    url: '/api2/json/nodes/' + nodename + '/storage/' + storage + '/status'
 	});
 
diff --git a/www/manager6/storage/Summary.js b/www/manager6/storage/Summary.js
index 4b26f234..7ea40c95 100644
--- a/www/manager6/storage/Summary.js
+++ b/www/manager6/storage/Summary.js
@@ -26,7 +26,7 @@ Ext.define('PVE.storage.Summary', {
 	    throw "no storage ID specified";
 	}
 
-	var rstore  = Ext.create('PVE.data.ObjectStore', {
+	var rstore  = Ext.create('Proxmox.data.ObjectStore', {
 	    url: "/api2/json/nodes/" + nodename + "/storage/" + storage + "/status",
 	    interval: 1000
 	});
-- 
2.11.0





More information about the pve-devel mailing list