[pve-devel] r6065 - in pve-manager/pve2/www/manager: . storage
svn-commits at proxmox.com
svn-commits at proxmox.com
Tue May 31 11:49:32 CEST 2011
Author: dietmar
Date: 2011-05-31 11:49:32 +0200 (Tue, 31 May 2011)
New Revision: 6065
Added:
pve-manager/pve2/www/manager/storage/ContentView.js
Modified:
pve-manager/pve2/www/manager/Makefile.am
pve-manager/pve2/www/manager/storage/Browser.js
Log:
impl. content View
Modified: pve-manager/pve2/www/manager/Makefile.am
===================================================================
--- pve-manager/pve2/www/manager/Makefile.am 2011-05-31 09:28:39 UTC (rev 6064)
+++ pve-manager/pve2/www/manager/Makefile.am 2011-05-31 09:49:32 UTC (rev 6065)
@@ -55,6 +55,7 @@
qemu/HardwareView.js \
qemu/CreateWizard.js \
openvz/CreateWizard.js \
+ storage/ContentView.js \
storage/StatusView.js \
storage/Summary.js \
storage/Browser.js \
Modified: pve-manager/pve2/www/manager/storage/Browser.js
===================================================================
--- pve-manager/pve2/www/manager/storage/Browser.js 2011-05-31 09:28:39 UTC (rev 6064)
+++ pve-manager/pve2/www/manager/storage/Browser.js 2011-05-31 09:49:32 UTC (rev 6065)
@@ -23,7 +23,7 @@
itemId: 'summary'
},
{
- //xtype: 'pveStorageContent',
+ xtype: 'pveStorageContentView',
title: 'Content',
itemId: 'content'
},
Added: pve-manager/pve2/www/manager/storage/ContentView.js
===================================================================
--- pve-manager/pve2/www/manager/storage/ContentView.js (rev 0)
+++ pve-manager/pve2/www/manager/storage/ContentView.js 2011-05-31 09:49:32 UTC (rev 6065)
@@ -0,0 +1,70 @@
+Ext.define('PVE.storage.ContentView', {
+ extend: 'Ext.grid.GridPanel',
+
+ alias: ['widget.pveStorageContentView'],
+
+ 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 store = new Ext.data.Store({
+ model: Ext.define('pve-storage-content', {
+ extend: 'Ext.data.Model',
+ fields: [
+ 'volid', 'format', 'size', 'used', 'vmid'
+ ],
+ idProperty: 'volid'
+ }),
+ proxy: {
+ type: 'pve',
+ url: "/api2/json/nodes/" + nodename + "/storage/" + storage + "/content"
+ },
+ sorters: {
+ property: 'volid',
+ order: 'DESC'
+ }
+ });
+
+
+ Ext.apply(me, {
+ store: store,
+ stateful: false,
+ viewConfig: {
+ trackOver: false
+ },
+ columns: [
+ {
+ header: 'Name',
+ flex: 1,
+ sortable: true,
+ dataIndex: 'volid'
+ },
+ {
+ header: 'Format',
+ width: 100,
+ dataIndex: 'format'
+ },
+ {
+ header: 'Size',
+ width: 100,
+ renderer: PVE.Utils.format_size,
+ dataIndex: 'size'
+ }
+ ],
+ listeners: {
+ show: function() {
+ store.load();
+ }
+ }
+ });
+
+ me.callParent();
+ }
+});
\ No newline at end of file
More information about the pve-devel
mailing list