[pve-devel] [PATCH manager 09/19] add rrd models

Dominik Csapak d.csapak at proxmox.com
Thu Dec 21 13:36:12 CET 2017


they will be used with the rrdstore

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/Makefile                 |  1 +
 www/manager6/data/models/RRDModels.js | 62 +++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)
 create mode 100644 www/manager6/data/models/RRDModels.js

diff --git a/www/manager6/Makefile b/www/manager6/Makefile
index c87b6fdc..90f56c3c 100644
--- a/www/manager6/Makefile
+++ b/www/manager6/Makefile
@@ -26,6 +26,7 @@ JSSRC= 				                 	\
 	data/ObjectStore.js				\
 	data/ResourceStore.js				\
 	data/RRDStore.js				\
+	data/models/RRDModels.js			\
 	form/VLanField.js				\
 	form/Checkbox.js				\
 	form/RRDTypeSelector.js				\
diff --git a/www/manager6/data/models/RRDModels.js b/www/manager6/data/models/RRDModels.js
new file mode 100644
index 00000000..0c8a12bd
--- /dev/null
+++ b/www/manager6/data/models/RRDModels.js
@@ -0,0 +1,62 @@
+Ext.define('pve-rrd-node', {
+    extend: 'Ext.data.Model',
+    fields: [
+	{
+	    name:'cpu',
+	    // percentage
+	    convert: function(value) {
+		return value*100;
+	    }
+	},
+	{
+	    name:'iowait',
+	    // percentage
+	    convert: function(value) {
+		return value*100;
+	    }
+	},
+	'loadavg',
+	'maxcpu',
+	'memtotal',
+	'memused',
+	'netin',
+	'netout',
+	'roottotal',
+	'rootused',
+	'swaptotal',
+	'swapused',
+	{ type: 'date', dateFormat: 'timestamp', name: 'time' }
+    ]
+});
+
+Ext.define('pve-rrd-guest', {
+    extend: 'Ext.data.Model',
+    fields: [
+	{
+	    name:'cpu',
+	    // percentage
+	    convert: function(value) {
+		return value*100;
+	    }
+	},
+	'maxcpu',
+	'netin',
+	'netout',
+	'mem',
+	'maxmem',
+	'disk',
+	'maxdisk',
+	'diskread',
+	'diskwrite',
+	{ type: 'date', dateFormat: 'timestamp', name: 'time' }
+    ]
+});
+
+Ext.define('pve-rrd-storage', {
+    extend: 'Ext.data.Model',
+    fields: [
+	'used',
+	'total',
+	{ type: 'date', dateFormat: 'timestamp', name: 'time' }
+    ]
+});
-- 
2.11.0





More information about the pve-devel mailing list