[pve-devel] r5774 - pve-manager/pve2/www/new/data

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Apr 1 10:45:06 CEST 2011


Author: dietmar
Date: 2011-04-01 10:45:06 +0200 (Fri, 01 Apr 2011)
New Revision: 5774

Added:
   pve-manager/pve2/www/new/data/RessourceStore.js
Log:


Added: pve-manager/pve2/www/new/data/RessourceStore.js
===================================================================
--- pve-manager/pve2/www/new/data/RessourceStore.js	                        (rev 0)
+++ pve-manager/pve2/www/new/data/RessourceStore.js	2011-04-01 08:45:06 UTC (rev 5774)
@@ -0,0 +1,109 @@
+Ext.define('PVE.data.ResourceStore', {
+    extend: 'Ext.data.UpdateStore',
+    requires: ['PVE.Utils'],
+    singleton: true,
+
+    constructor: function() {
+	var self = this;
+
+	var field_defaults = {
+	    type: {
+		header: 'Type',
+		type: 'text',
+		renderer: PVE.Utils.render_itype,
+		width: 50
+	    },
+	    id: {
+		header: 'ID',
+		hidden: true,
+		type: 'text'
+	    },
+	    vmid: {
+		header: 'VMID',
+		hidden: true,
+		type: 'integer'
+	    },
+	    name: {
+		header: 'Name',
+		type: 'text'
+	    },
+	    disk: {
+		header: 'Disk',
+		type: 'integer',
+		renderer: PVE.Utils.render_disk,
+		width: 60
+	    },
+	    maxdisk: {
+		header: 'maxdisk',
+		type: 'integer',
+		hidden: true,
+		width: 60
+	    },
+	    mem: {
+		header: 'Memory',
+		type: 'integer',
+		renderer: PVE.Utils.render_mem,
+		width: 60
+	    },
+	    maxmem: {
+		header: 'maxmem',
+		type:'integer',
+		hidden: true,
+		width: 60
+	    },
+	    cpu: {
+		header: 'CPU',
+		type: 'float',
+		renderer: PVE.Utils.render_cpu,
+		width: 85
+	    },
+	    maxcpu: {
+		header: 'maxcpu',
+		type: 'integer',
+		hidden: true,
+		width: 60
+	    },
+	    uptime: {
+		header: 'Uptime',
+		type: 'integer',
+		renderer: PVE.Utils.render_uptime,
+		width: 110
+	    }, 
+	    node: {
+		header: 'Node',
+		type: 'text',
+		hidden: true,
+		width: 110
+	    },
+	    storage: {
+		header: 'Storage',
+		type: 'text',
+		hidden: true,
+		width: 110
+	    }
+	};
+
+	var fields = field_defaults.getKeys;
+
+	Ext.regModel('PVEResources', {
+	    fields: fields,
+	    proxy: {
+		type: 'pve',
+		url: '/api2/json/cluster/resources'
+	    }
+	});
+
+	Ext.regModel('PVETree', {
+	    fields: fields,
+	    proxy: { type: 'memory' }
+	});
+
+	Ext.apply(self, {
+	    storeid: 'PVEResources',
+	    model: 'PVEResources',
+	    autoDestory: false,
+	});
+
+	self.callParent();
+    }
+});



More information about the pve-devel mailing list