[pve-devel] r6059 - in pve-manager/pve2/www/manager: . node qemu storage

svn-commits at proxmox.com svn-commits at proxmox.com
Tue May 31 09:50:46 CEST 2011


Author: dietmar
Date: 2011-05-31 09:50:46 +0200 (Tue, 31 May 2011)
New Revision: 6059

Added:
   pve-manager/pve2/www/manager/storage/StatusView.js
Modified:
   pve-manager/pve2/www/manager/Makefile.am
   pve-manager/pve2/www/manager/node/Summary.js
   pve-manager/pve2/www/manager/qemu/Summary.js
   pve-manager/pve2/www/manager/storage/Summary.js
Log:
cleanups


Modified: pve-manager/pve2/www/manager/Makefile.am
===================================================================
--- pve-manager/pve2/www/manager/Makefile.am	2011-05-31 07:45:10 UTC (rev 6058)
+++ pve-manager/pve2/www/manager/Makefile.am	2011-05-31 07:50:46 UTC (rev 6059)
@@ -55,6 +55,7 @@
 	qemu/HardwareView.js				\
 	qemu/CreateWizard.js				\
 	openvz/CreateWizard.js				\
+	storage/StatusView.js				\
 	storage/Summary.js				\
 	storage/Browser.js				\
 	dc/StorageView.js				\

Modified: pve-manager/pve2/www/manager/node/Summary.js
===================================================================
--- pve-manager/pve2/www/manager/node/Summary.js	2011-05-31 07:45:10 UTC (rev 6058)
+++ pve-manager/pve2/www/manager/node/Summary.js	2011-05-31 07:50:46 UTC (rev 6059)
@@ -15,7 +15,7 @@
 	    width: 800
 	});
 
-	rstore = statusview.rstore;
+	var rstore = statusview.rstore;
 
 	var node_command = function(cmd) {
 	    me.setLoading(true, true);

Modified: pve-manager/pve2/www/manager/qemu/Summary.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/Summary.js	2011-05-31 07:45:10 UTC (rev 6058)
+++ pve-manager/pve2/www/manager/qemu/Summary.js	2011-05-31 07:50:46 UTC (rev 6059)
@@ -19,7 +19,7 @@
 	    width: 400
 	});
 
-	rstore = statusview.rstore;
+	var rstore = statusview.rstore;
 
 	var rrdurl = "/api2/png/nodes/" + nodename + "/qemu/" + vmid + "/rrd";
 

Added: pve-manager/pve2/www/manager/storage/StatusView.js
===================================================================
--- pve-manager/pve2/www/manager/storage/StatusView.js	                        (rev 0)
+++ pve-manager/pve2/www/manager/storage/StatusView.js	2011-05-31 07:50:46 UTC (rev 6059)
@@ -0,0 +1,60 @@
+Ext.define('PVE.storage.StatusView', {
+    extend: 'PVE.grid.ObjectGrid',
+    alias: ['widget.pveStorageStatusView'],
+
+    initComponent : function() {
+	var me = this;
+
+	var nodename = me.pveSelNode.data.node;
+	if (!nodename) 
+	    throw "no node name specified";
+
+	var storage = me.pveSelNode.data.storage;
+	if (!storage) 
+	    throw "no storage ID specified";
+
+	var rows = {
+	    active: {
+		header: 'Active', required: true
+	    },
+	    content: {
+		header: 'Content', required: true
+	    },
+	    type: {
+		header: 'Type', required: true
+	    },
+	    shared: {
+		header: 'Shared', required: true
+	    },
+	    disable: {
+		header: 'Disable', required: true
+	    },
+	    total: {
+		header: 'Size', 
+		required: true, 
+		renderer: PVE.Utils.render_size
+	    },
+	    used: {
+		header: 'Used', 
+		required: true, 
+		renderer: PVE.Utils.render_size
+	    },
+	    avail: {
+		header: 'Avail', 
+		required: true, 
+		renderer: PVE.Utils.render_size
+	    }
+	};
+
+	Ext.applyIf(me, {
+	    url: "/api2/json/nodes/" + nodename + "/storage",
+	    extraParams: { storage: storage },
+	    cwidth1: 150,
+	    interval: 5000,
+	    height: 205,
+	    rows: rows
+	});
+
+	me.callParent();
+    }
+});

Modified: pve-manager/pve2/www/manager/storage/Summary.js
===================================================================
--- pve-manager/pve2/www/manager/storage/Summary.js	2011-05-31 07:45:10 UTC (rev 6058)
+++ pve-manager/pve2/www/manager/storage/Summary.js	2011-05-31 07:50:46 UTC (rev 6059)
@@ -13,46 +13,14 @@
 	if (!storage) 
 	    throw "no storage ID specified";
 
-	var rows = {
-	    active: {
-		header: 'Active', required: true
-	    },
-	    content: {
-		header: 'Content', required: true
-	    },
-	    type: {
-		header: 'Type', required: true
-	    },
-	    shared: {
-		header: 'Shared', required: true
-	    },
-	    disable: {
-		header: 'Disable', required: true
-	    },
-	    total: {
-		header: 'Size', 
-		required: true, 
-		renderer: PVE.Utils.render_size
-	    },
-	    used: {
-		header: 'Used', 
-		required: true, 
-		renderer: PVE.Utils.render_size
-	    },
-	    avail: {
-		header: 'Avail', 
-		required: true, 
-		renderer: PVE.Utils.render_size
-	    }
-	};
-
-	rstore = Ext.create('PVE.data.ObjectStore', { 
-	    url: "/api2/json/nodes/" + nodename + "/storage",
-	    extraParams: { storage: storage },
-	    interval: 1000,
-	    rows: rows,
+	var statusview = Ext.create('PVE.node.StatusView', {
+	    title: 'Status',
+	    pveSelNode: me.pveSelNode,
+	    width: 800
 	});
 
+	var rstore = statusview.rstore;
+
 	Ext.apply(me, {
 	    layout: {
 		type: 'table',
@@ -65,16 +33,7 @@
 	    },		
 	    //tbar: tbar,
 	    items: [
-		{
-		    title: 'Status',
-		    xtype: 'pveObjectGrid',
-		    rstore: rstore,
-		    rows: rows,
-		    cwidth1: 150,
-		    interval: 1000,
-		    height: 205,
-		    width: 800
-		}
+		statusview
 	    ]
 	});
 




More information about the pve-devel mailing list