Commit ccd0f55b authored by Dietmar Maurer's avatar Dietmar Maurer

copy data/UpdateStore.js from manager to manager5

parent 5b936f84
Ext.define('PVE.data.UpdateStore', {
extend: 'Ext.data.Store',
constructor: function(config) {
var me = this;
config = config || {};
if (!config.interval) {
config.interval = 3000;
}
if (!config.storeid) {
throw "no storeid specified";
}
var load_task = new Ext.util.DelayedTask();
var run_load_task = function() {
if (PVE.Utils.authOK()) {
PVE.data.UpdateQueue.queue(me, function(runtime, success) {
var interval = config.interval + runtime*2;
load_task.delay(interval, run_load_task);
});
} else {
load_task.delay(200, run_load_task);
}
};
Ext.apply(config, {
startUpdate: function() {
run_load_task();
},
stopUpdate: function() {
load_task.cancel();
}
});
me.callParent([config]);
me.on('destroy', function() {
load_task.cancel();
});
}
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment