[pve-devel] r6057 - in pve-manager/pve2/www/manager: . data storage

svn-commits at proxmox.com svn-commits at proxmox.com
Tue May 31 09:30:16 CEST 2011


Author: dietmar
Date: 2011-05-31 09:30:16 +0200 (Tue, 31 May 2011)
New Revision: 6057

Added:
   pve-manager/pve2/www/manager/storage/Summary.js
Modified:
   pve-manager/pve2/www/manager/Makefile.am
   pve-manager/pve2/www/manager/data/ObjectStore.js
   pve-manager/pve2/www/manager/storage/Browser.js
Log:
impl. storage status view


Modified: pve-manager/pve2/www/manager/Makefile.am
===================================================================
--- pve-manager/pve2/www/manager/Makefile.am	2011-05-31 06:33:24 UTC (rev 6056)
+++ pve-manager/pve2/www/manager/Makefile.am	2011-05-31 07:30:16 UTC (rev 6057)
@@ -55,6 +55,7 @@
 	qemu/HardwareView.js				\
 	qemu/CreateWizard.js				\
 	openvz/CreateWizard.js				\
+	storage/Summary.js				\
 	storage/Browser.js				\
 	dc/StorageView.js				\
 	dc/UserView.js					\

Modified: pve-manager/pve2/www/manager/data/ObjectStore.js
===================================================================
--- pve-manager/pve2/www/manager/data/ObjectStore.js	2011-05-31 06:33:24 UTC (rev 6056)
+++ pve-manager/pve2/www/manager/data/ObjectStore.js	2011-05-31 07:30:16 UTC (rev 6057)
@@ -14,6 +14,7 @@
             proxy: {
                 type: 'pve',
 		url: config.url,
+		extraParams: config.extraParams,
                 reader: {
 		    type: 'jsonobject',
 		    rows: config.rows

Modified: pve-manager/pve2/www/manager/storage/Browser.js
===================================================================
--- pve-manager/pve2/www/manager/storage/Browser.js	2011-05-31 06:33:24 UTC (rev 6056)
+++ pve-manager/pve2/www/manager/storage/Browser.js	2011-05-31 07:30:16 UTC (rev 6057)
@@ -19,7 +19,7 @@
 	    items: [
 		{
 		    title: 'Summary',
-		    //xtype: 'pveStorageSummary',
+		    xtype: 'pveStorageSummary',
 		    itemId: 'summary'
 		},
 		{

Added: pve-manager/pve2/www/manager/storage/Summary.js
===================================================================
--- pve-manager/pve2/www/manager/storage/Summary.js	                        (rev 0)
+++ pve-manager/pve2/www/manager/storage/Summary.js	2011-05-31 07:30:16 UTC (rev 6057)
@@ -0,0 +1,87 @@
+Ext.define('PVE.storage.Summary', {
+    extend: 'Ext.panel.Panel',
+    alias: 'widget.pveStorageSummary',
+
+    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
+	    }
+	};
+
+	rstore = Ext.create('PVE.data.ObjectStore', { 
+	    url: "/api2/json/nodes/" + nodename + "/storage",
+	    extraParams: { storage: storage },
+	    interval: 1000,
+	    rows: rows,
+	});
+
+	Ext.apply(me, {
+	    layout: {
+		type: 'table',
+		columns: 1
+	    },
+	    autoScroll: true,
+	    bodyStyle: 'padding:10px',
+	    defaults: {
+		style: 'padding-bottom:10px'
+	    },		
+	    //tbar: tbar,
+	    items: [
+		{
+		    title: 'Status',
+		    xtype: 'pveObjectGrid',
+		    rstore: rstore,
+		    rows: rows,
+		    cwidth1: 150,
+		    interval: 1000,
+		    height: 205,
+		    width: 800
+		}
+	    ]
+	});
+
+	me.on('show', rstore.startUpdate);
+	me.on('hide', rstore.stopUpdate);
+	me.on('destroy', rstore.stopUpdate);	
+
+	me.callParent();
+    }
+});




More information about the pve-devel mailing list