]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - data/RRDStore.js
1 /* Extends the Proxmox.data.UpdateStore type
5 Ext
.define('Proxmox.data.RRDStore', {
6 extend
: 'Proxmox.data.UpdateStore',
7 alias
: 'store.proxmoxRRDStore',
9 setRRDUrl: function(timeframe
, cf
) {
12 timeframe
= me
.timeframe
;
19 me
.proxy
.url
= me
.rrdurl
+ "?timeframe=" + timeframe
+ "&cf=" + cf
;
30 constructor: function(config
) {
33 config
= config
|| {};
35 // set default interval to 30seconds
36 if (!config
.interval
) {
37 config
.interval
= 30000;
41 if (!config
.storeid
) {
42 config
.storeid
= 'rrdstore-' + ++Ext
.idSeed
;
47 throw "no rrdurl specified";
50 var stateid
= 'proxmoxRRDTypeSelection';
51 var sp
= Ext
.state
.Manager
.getProvider();
52 var stateinit
= sp
.get(stateid
);
55 if (stateinit
.timeframe
!== me
.timeframe
|| stateinit
.cf
!== me
.rrdcffn
) {
56 me
.timeframe
= stateinit
.timeframe
;
57 me
.rrdcffn
= stateinit
.cf
;
61 me
.callParent([config
]);
64 me
.mon(sp
, 'statechange', function(prov
, key
, state
) {
65 if (key
=== stateid
) {
66 if (state
&& state
.id
) {
67 if (state
.timeframe
!== me
.timeframe
|| state
.cf
!== me
.cf
) {
68 me
.timeframe
= state
.timeframe
;