[pve-devel] [PATCH manager] use new rrd graphs on storage summary pages
Dominik Csapak
d.csapak at proxmox.com
Thu Mar 31 15:29:26 CEST 2016
this was missing before
also fix styling error (style takes not a single string parameter)
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
www/manager6/data/RRDStore.js | 5 +++++
www/manager6/panel/RRDChart.js | 4 +++-
www/manager6/storage/Summary.js | 25 ++++++++++++++-----------
3 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/www/manager6/data/RRDStore.js b/www/manager6/data/RRDStore.js
index d2275fb..0d7a877 100644
--- a/www/manager6/data/RRDStore.js
+++ b/www/manager6/data/RRDStore.js
@@ -57,6 +57,11 @@ Ext.define('PVE.data.RRDStore', {
'diskread',
'diskwrite',
'maxdisk',
+
+ // missing storage fields
+ 'used',
+ 'total',
+
// for time we generate unix timestamps, javascript uses milliseconds instead of seconds
{ name:'time', convert: function(value) { return value*1000; }},
],
diff --git a/www/manager6/panel/RRDChart.js b/www/manager6/panel/RRDChart.js
index ae606a5..c2742b4 100644
--- a/www/manager6/panel/RRDChart.js
+++ b/www/manager6/panel/RRDChart.js
@@ -37,7 +37,9 @@ Ext.define('PVE.widget.RRDChart', {
'maxmem',
'mem',
'disk',
- 'maxdisk'
+ 'maxdisk',
+ 'total',
+ 'used',
],
bytespersArr: [
'netin',
diff --git a/www/manager6/storage/Summary.js b/www/manager6/storage/Summary.js
index 3b3d86b..b0bfb35 100644
--- a/www/manager6/storage/Summary.js
+++ b/www/manager6/storage/Summary.js
@@ -4,7 +4,7 @@ Ext.define('PVE.storage.Summary', {
scrollable: true,
bodyPadding: 10,
defaults: {
- style: 'padding-top:10px',
+ style: {'padding-top':'10px'},
width: 800
},
tbar: [
@@ -33,25 +33,28 @@ Ext.define('PVE.storage.Summary', {
var rstore = statusview.rstore;
- var rrdurl = "/api2/png/nodes/" + nodename + "/storage/" + storage + "/rrd";
+ var rrdstore = Ext.create('PVE.data.RRDStore', {
+ rrdurl: "/api2/json/nodes/" + nodename + "/storage/" + storage + "/rrddata",
+ });
Ext.apply(me, {
items: [
statusview,
{
- xtype: 'pveRRDView',
+ xtype: 'pveRRDChart',
title: gettext('Usage'),
- pveSelNode: me.pveSelNode,
- datasource: 'total,used',
- rrdurl: rrdurl
+ fields: ['total','used'],
+ fieldTitles: ['Total Size', 'Used Size'],
+ store: rrdstore
}
- ]
+ ],
+ listeners: {
+ activate: function() { rstore.startUpdate(); rrdstore.startUpdate(); },
+ hide: function() { rstore.stopUpdate(); rrdstore.stopUpdate(); },
+ destroy: function() { rstore.stopUpdate(); rrdstore.stopUpdate(); },
+ }
});
- me.on('activate', rstore.startUpdate);
- me.on('hide', rstore.stopUpdate);
- me.on('destroy', rstore.stopUpdate);
-
me.callParent();
}
});
--
2.1.4
More information about the pve-devel
mailing list