pve-manager/www/manager6/storage/Summary.js
Dominik Csapak 921324b6e1 use new rrd graphs on storage summary pages
this was missing before
also fix styling error (style takes not a single string parameter)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2016-03-31 17:17:40 +02:00

61 lines
1.3 KiB
JavaScript

Ext.define('PVE.storage.Summary', {
extend: 'Ext.panel.Panel',
alias: 'widget.pveStorageSummary',
scrollable: true,
bodyPadding: 10,
defaults: {
style: {'padding-top':'10px'},
width: 800
},
tbar: [
'->',
{
xtype: 'pveRRDTypeSelector'
}
],
initComponent: function() {
var me = this;
var nodename = me.pveSelNode.data.node;
if (!nodename) {
throw "no node name specified";
}
var storage = me.pveSelNode.data.storage;
if (!storage) {
throw "no storage ID specified";
}
var statusview = Ext.create('PVE.storage.StatusView', {
pveSelNode: me.pveSelNode,
style: 'padding-top:0px'
});
var rstore = statusview.rstore;
var rrdstore = Ext.create('PVE.data.RRDStore', {
rrdurl: "/api2/json/nodes/" + nodename + "/storage/" + storage + "/rrddata",
});
Ext.apply(me, {
items: [
statusview,
{
xtype: 'pveRRDChart',
title: gettext('Usage'),
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.callParent();
}
});