VNCConsole.js \
data/TimezoneStore.js \
data/PVEProxy.js \
- data/UpdateQueue.js \
- data/UpdateStore.js \
data/DiffStore.js \
data/ObjectStore.js \
data/ResourceStore.js \
var sm = Ext.create('Ext.selection.RowModel', {});
- var rstore = Ext.create('PVE.data.UpdateStore', {
+ var rstore = Ext.create('Proxmox.data.UpdateStore', {
interval: 3000,
storeid: 'ceph-mon-list' + nodename,
model: 'ceph-mon-list',
var sm = Ext.create('Ext.selection.RowModel', {});
- var rstore = Ext.create('PVE.data.UpdateStore', {
+ var rstore = Ext.create('Proxmox.data.UpdateStore', {
interval: 3000,
storeid: 'ceph-pool-list' + nodename,
model: 'ceph-pool-list',
}
me.callParent();
- me.store = Ext.create('PVE.data.UpdateStore', {
+ me.store = Ext.create('Proxmox.data.UpdateStore', {
storeid: 'ceph-status-' + nodename,
interval: 5000,
proxy: {
* Designed to work with the KeyValue model and the JsonObject data reader
*/
Ext.define('PVE.data.ObjectStore', {
- extend: 'PVE.data.UpdateStore',
+ extend: 'Proxmox.data.UpdateStore',
constructor: function(config) {
var me = this;
Ext.define('PVE.data.ResourceStore', {
- extend: 'PVE.data.UpdateStore',
+ extend: 'Proxmox.data.UpdateStore',
singleton: true,
findVMID: function(vmid) {
+++ /dev/null
-// Serialize load (avoid too many parallel connections)
-Ext.define('PVE.data.UpdateQueue', {
- singleton: true,
-
- constructor : function(){
- var me = this;
-
- var queue = [];
- var queue_idx = {};
-
- var idle = true;
-
- var start_update = function() {
- if (!idle) {
- return;
- }
-
- var storeid = queue.shift();
- if (!storeid) {
- return;
- }
- var info = queue_idx[storeid];
- queue_idx[storeid] = null;
-
- info.updatestart = new Date();
-
- idle = false;
- info.store.load({
- callback: function(records, operation, success) {
- idle = true;
- if (info.callback) {
- var runtime = (new Date()).getTime() - info.updatestart.getTime();
- info.callback(runtime, success);
- }
- start_update();
- }
- });
- };
-
- Ext.apply(me, {
- queue: function(store, cb) {
- var storeid = store.storeid;
- if (!storeid) {
- throw "unable to queue store without storeid";
- }
- if (!queue_idx[storeid]) {
- queue_idx[storeid] = {
- store: store,
- callback: cb
- };
- queue.push(storeid);
- }
- start_update();
- },
- unqueue: function(store) {
- var storeid = store.storeid;
- if (!storeid) {
- throw "unabel to unqueue store without storeid";
- }
- if (queue_idx[storeid]) {
- Ext.Array.remove(queue,storeid);
- queue_idx[storeid] = null;
- }
- }
- });
- }
-});
+++ /dev/null
-/* Extends the Ext.data.Store type
- * with startUpdate() and stopUpdate() methods
- * to refresh the store data in the background
- * Components using this store directly will flicker
- * due to the redisplay of the element ater 'config.interval' ms
- *
- * Note that you have to call yourself startUpdate() for the background load
- * to begin
- */
-Ext.define('PVE.data.UpdateStore', {
- extend: 'Ext.data.Store',
-
- isStopped: true,
-
- destroy: function() {
- var me = this;
- me.load_task.cancel();
- PVE.data.UpdateQueue.unqueue(me);
- me.callParent();
- },
-
- 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 (me.isStopped) {
- return;
- }
-
- 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() {
- me.isStopped = false;
- run_load_task();
- },
- stopUpdate: function() {
- me.isStopped = true;
- load_task.cancel();
- PVE.data.UpdateQueue.unqueue(me);
- }
- });
-
- me.callParent([config]);
-
- me.load_task = load_task;
- }
-});
initComponent: function() {
var me = this;
- me.cephstore = Ext.create('PVE.data.UpdateStore', {
+ me.cephstore = Ext.create('Proxmox.data.UpdateStore', {
interval: 3000,
storeid: 'pve-cluster-ceph',
proxy: {
initComponent : function() {
var me = this;
- var logstore = new PVE.data.UpdateStore({
+ var logstore = Ext.create('Proxmox.data.UpdateStore', {
storeid: 'pve-cluster-log',
model: 'pve-cluster-log',
proxy: {
initComponent: function() {
var me = this;
- var rstore = Ext.create('PVE.data.UpdateStore', {
+ var rstore = Ext.create('Proxmox.data.UpdateStore', {
interval: 3000,
storeid: 'pve-cluster-status',
model: 'pve-dc-nodes',
initComponent : function() {
var me = this;
- var taskstore = new PVE.data.UpdateStore({
+ var taskstore = Ext.create('Proxmox.data.UpdateStore', {
storeid: 'pve-cluster-tasks',
model: 'pve-tasks',
proxy: {
}
);
- me.rstore = Ext.create('PVE.data.UpdateStore', {
+ me.rstore = Ext.create('Proxmox.data.UpdateStore', {
storeid: 'pve-replica-' + me.nodename + me.vmid,
model: (mode === 'dc')? 'pve-replication' : 'pve-replication-state',
interval: 3000,
throw "no node name specified";
}
- var rstore = Ext.create('PVE.data.UpdateStore', {
+ var rstore = Ext.create('Proxmox.data.UpdateStore', {
interval: 1000,
storeid: 'pve-services' + nodename,
model: 'pve-services',