]>
Commit | Line | Data |
---|---|---|
af51679a DM |
1 | Ext.define('PVE.storage.Summary', { |
2 | extend: 'Ext.panel.Panel', | |
3 | alias: 'widget.pveStorageSummary', | |
e857c94a | 4 | scrollable: true, |
77306233 | 5 | bodyPadding: 5, |
e857c94a DC |
6 | tbar: [ |
7 | '->', | |
8 | { | |
f6710aac TL |
9 | xtype: 'proxmoxRRDTypeSelector', |
10 | }, | |
e857c94a | 11 | ], |
77306233 | 12 | layout: { |
f6710aac | 13 | type: 'column', |
77306233 DC |
14 | }, |
15 | defaults: { | |
16 | padding: 5, | |
f6710aac | 17 | columnWidth: 1, |
77306233 | 18 | }, |
af51679a DM |
19 | initComponent: function() { |
20 | var me = this; | |
21 | ||
22 | var nodename = me.pveSelNode.data.node; | |
23 | if (!nodename) { | |
24 | throw "no node name specified"; | |
25 | } | |
26 | ||
27 | var storage = me.pveSelNode.data.storage; | |
28 | if (!storage) { | |
29 | throw "no storage ID specified"; | |
30 | } | |
31 | ||
8058410f | 32 | var rstore = Ext.create('Proxmox.data.ObjectStore', { |
19e2978b | 33 | url: "/api2/json/nodes/" + nodename + "/storage/" + storage + "/status", |
f6710aac | 34 | interval: 1000, |
19e2978b DC |
35 | }); |
36 | ||
5536d678 | 37 | var rrdstore = Ext.create('Proxmox.data.RRDStore', { |
8058410f | 38 | rrdurl: "/api2/json/nodes/" + nodename + "/storage/" + storage + "/rrddata", |
f6710aac | 39 | model: 'pve-rrd-storage', |
921324b6 | 40 | }); |
af51679a DM |
41 | |
42 | Ext.apply(me, { | |
af51679a | 43 | items: [ |
413613df DC |
44 | { |
45 | xtype: 'pveStorageStatusView', | |
46 | pveSelNode: me.pveSelNode, | |
f6710aac | 47 | rstore: rstore, |
413613df | 48 | }, |
af51679a | 49 | { |
5536d678 | 50 | xtype: 'proxmoxRRDChart', |
af51679a | 51 | title: gettext('Usage'), |
f6710aac | 52 | fields: ['total', 'used'], |
921324b6 | 53 | fieldTitles: ['Total Size', 'Used Size'], |
f6710aac TL |
54 | store: rrdstore, |
55 | }, | |
921324b6 DC |
56 | ], |
57 | listeners: { | |
58 | activate: function() { rstore.startUpdate(); rrdstore.startUpdate(); }, | |
f6710aac TL |
59 | destroy: function() { rstore.stopUpdate(); rrdstore.stopUpdate(); }, |
60 | }, | |
af51679a DM |
61 | }); |
62 | ||
af51679a | 63 | me.callParent(); |
f6710aac | 64 | }, |
af51679a | 65 | }); |