[pve-devel] r6421 - in pve-manager/pve2: . www/manager www/manager/form www/manager/storage

svn-commits at proxmox.com svn-commits at proxmox.com
Fri Aug 5 07:49:44 CEST 2011


Author: dietmar
Date: 2011-08-05 07:49:44 +0200 (Fri, 05 Aug 2011)
New Revision: 6421

Modified:
   pve-manager/pve2/ChangeLog
   pve-manager/pve2/www/manager/Utils.js
   pve-manager/pve2/www/manager/form/FileSelector.js
   pve-manager/pve2/www/manager/storage/ContentView.js
Log:
	* www/manager/Utils.js (render_storage_content): new method to
	render volid



Modified: pve-manager/pve2/ChangeLog
===================================================================
--- pve-manager/pve2/ChangeLog	2011-08-05 05:22:24 UTC (rev 6420)
+++ pve-manager/pve2/ChangeLog	2011-08-05 05:49:44 UTC (rev 6421)
@@ -1,3 +1,8 @@
+2011-08-05  Proxmox Support Team  <support at proxmox.com>
+
+	* www/manager/Utils.js (render_storage_content): new method to
+	render volid
+
 2011-08-02  Proxmox Support Team  <support at proxmox.com>
 
 	* www/manager/window/Edit.js: convert empty array to ''

Modified: pve-manager/pve2/www/manager/Utils.js
===================================================================
--- pve-manager/pve2/www/manager/Utils.js	2011-08-05 05:22:24 UTC (rev 6420)
+++ pve-manager/pve2/www/manager/Utils.js	2011-08-05 05:49:44 UTC (rev 6421)
@@ -517,6 +517,18 @@
 	return cta.join(', ');
     },
 
+    render_storage_content: function(value, metaData, record) {
+	var data = record.data;
+	if (Ext.isNumber(data.channel) &&
+	    Ext.isNumber(data.id) &&
+	    Ext.isNumber(data.lun)) {
+	    return "CH " + 
+		Ext.String.leftPad(data.channel,2, '0') + 
+		" ID " + data.id + " LUN " + data.lun;
+	}
+	return data.volid.replace(/^.*:(.*\/)?/,'');
+    },
+
     render_serverity: function (value) {
 	return PVE.Utils.log_severity_hash[value] || value;
     },

Modified: pve-manager/pve2/www/manager/form/FileSelector.js
===================================================================
--- pve-manager/pve2/www/manager/form/FileSelector.js	2011-08-05 05:22:24 UTC (rev 6420)
+++ pve-manager/pve2/www/manager/form/FileSelector.js	2011-08-05 05:49:44 UTC (rev 6421)
@@ -50,15 +50,7 @@
 			if (value) {
 			    return value;
 			}
-			var data = record.data;
-			if (Ext.isNumber(data.channel) &&
-			    Ext.isNumber(data.id) &&
-			    Ext.isNumber(data.lun)) {
-			    return "CH " + 
-				Ext.String.leftPad(data.channel,2, '0') + 
-				" ID " + data.id + " LUN " + data.lun;
-			}
-			return data.volid.replace(/^.*:.*\//,'');
+			return PVE.Utils.render_storage_content(value, {}, record);
 		    }
 		}
 	    ]

Modified: pve-manager/pve2/www/manager/storage/ContentView.js
===================================================================
--- pve-manager/pve2/www/manager/storage/ContentView.js	2011-08-05 05:22:24 UTC (rev 6420)
+++ pve-manager/pve2/www/manager/storage/ContentView.js	2011-08-05 05:49:44 UTC (rev 6421)
@@ -40,6 +40,7 @@
 		    header: 'Name',
 		    flex: 1,
 		    sortable: true,
+		    renderer: PVE.Utils.render_storage_content,
 		    dataIndex: 'volid'
 		},
 		{
@@ -68,7 +69,8 @@
     Ext.define('pve-storage-content', {
 	extend: 'Ext.data.Model',
 	fields: [ 
-	    'volid', 'format', 'size', 'used', 'vmid'
+	    'volid', 'format', 'size', 'used', 'vmid', 
+	    'channel', 'id', 'lun'
 	],
 	idProperty: 'volid'
     });



More information about the pve-devel mailing list