[pve-devel] r6022 - in pve-manager/pve2/www: css new new/grid new/window

svn-commits at proxmox.com svn-commits at proxmox.com
Thu May 26 08:47:19 CEST 2011


Author: dietmar
Date: 2011-05-26 08:47:18 +0200 (Thu, 26 May 2011)
New Revision: 6022

Added:
   pve-manager/pve2/www/new/grid/SelectFeature.js
Modified:
   pve-manager/pve2/www/css/ext-pve.css
   pve-manager/pve2/www/new/Makefile.am
   pve-manager/pve2/www/new/Workspace.js
   pve-manager/pve2/www/new/window/TaskViewer.js
Log:
impl. selectable feature


Modified: pve-manager/pve2/www/css/ext-pve.css
===================================================================
--- pve-manager/pve2/www/css/ext-pve.css	2011-05-25 17:00:25 UTC (rev 6021)
+++ pve-manager/pve2/www/css/ext-pve.css	2011-05-26 06:47:18 UTC (rev 6022)
@@ -3,6 +3,11 @@
     line-height: 13px;
 }
 
+.x-selectable, .x-selectable * {
+    -moz-user-select: text!important;
+    -khtml-user-select: text!important;
+}
+
 .pve-itype-icon-display,
 .pve-itype-icon-memory,
 .pve-itype-icon-processor,

Modified: pve-manager/pve2/www/new/Makefile.am
===================================================================
--- pve-manager/pve2/www/new/Makefile.am	2011-05-25 17:00:25 UTC (rev 6021)
+++ pve-manager/pve2/www/new/Makefile.am	2011-05-26 06:47:18 UTC (rev 6022)
@@ -30,6 +30,7 @@
 	window/LoginWindow.js				\
 	window/TaskViewer.js				\
 	window/Wizard.js				\
+	grid/SelectFeature.js				\
 	grid/ObjectGrid.js				\
 	grid/ResourceGrid.js				\
 	tree/ResourceTree.js				\

Modified: pve-manager/pve2/www/new/Workspace.js
===================================================================
--- pve-manager/pve2/www/new/Workspace.js	2011-05-25 17:00:25 UTC (rev 6021)
+++ pve-manager/pve2/www/new/Workspace.js	2011-05-26 06:47:18 UTC (rev 6022)
@@ -199,7 +199,7 @@
 	var ui = me.query('#userinfo')[0];
 
 	if (PVE.UserName) {
-	    ui.update('<div style="white-space:nowrap;">You are logged in as "' + PVE.UserName + '"</div>');
+	    ui.update('<div class="x-unselectable" style="white-space:nowrap;">You are logged in as "' + PVE.UserName + '"</div>');
 	} else {
 	    ui.update('');
 	}
@@ -282,13 +282,13 @@
 		    items: [
 			{
 			    margins: '0 0 0 4',
-			    html: '<a target=_blank href="http://www.proxmox.com">' +
+			    html: '<a class="x-unselectable" target=_blank href="http://www.proxmox.com">' +
 				'<img height=30 width=209 src="/pve2/images/proxmox_logo.png"/></a>'
 			},
 			{
 			    minWidth: 200,
 			    flex: 1,
-			    html: '<span class="x-panel-header-text">Proxmox Virtual Environment</span><br>Version ' + PVE.GUIVersion
+			    html: '<span class="x-panel-header-text">Proxmox Virtual Environment<br>Version ' + PVE.GUIVersion + "</span>"
 			},
 			{
 			    pack: 'end',

Added: pve-manager/pve2/www/new/grid/SelectFeature.js
===================================================================
--- pve-manager/pve2/www/new/grid/SelectFeature.js	                        (rev 0)
+++ pve-manager/pve2/www/new/grid/SelectFeature.js	2011-05-26 06:47:18 UTC (rev 6022)
@@ -0,0 +1,34 @@
+Ext.override(Ext.view.Table, {
+    afterRender: function() {
+        var me = this;
+        
+        me.callParent();
+        me.mon(me.el, {
+            scroll: me.fireBodyScroll,
+            scope: me
+        });
+	if (!me.featuresMC ||
+	    (me.featuresMC.findIndex('ftype', 'selectable') < 0))
+            me.el.unselectable();
+
+        me.attachEventsForFeatures();
+    }
+});
+
+Ext.define('PVE.grid.SelectFeature', {
+    extend: 'Ext.grid.feature.Feature',
+    alias: 'feature.selectable',
+
+    mutateMetaRowTpl: function(metaRowTpl) {
+	var i,
+	ln = metaRowTpl.length;
+	
+	for (i = 0; i < ln; i++) {
+	    tpl = metaRowTpl[i];
+	    tpl = tpl.replace(/x-grid-row/, 'x-grid-row x-selectable');
+	    tpl = tpl.replace(/x-grid-cell-inner x-unselectable/g, 'x-grid-cell-inner');
+	    tpl = tpl.replace(/unselectable="on"/g, '');
+	    metaRowTpl[i] = tpl;
+	};
+    }	
+});

Modified: pve-manager/pve2/www/new/window/TaskViewer.js
===================================================================
--- pve-manager/pve2/www/new/window/TaskViewer.js	2011-05-25 17:00:25 UTC (rev 6021)
+++ pve-manager/pve2/www/new/window/TaskViewer.js	2011-05-26 06:47:18 UTC (rev 6022)
@@ -11,10 +11,10 @@
 	if (!me.upid)
 	    throw "no task specified";
 
-	console.log("TEST " + me.upid);
+	//console.log("TEST " + me.upid);
 
 	var task = PVE.Utils.parse_task_upid(me.upid);
-	console.dir(task);
+	//console.dir(task);
 
 	var store = Ext.create('Ext.data.Store', {
  	    model: Ext.define('pve-string-list', {
@@ -32,8 +32,6 @@
 	    },
 	});
 
-	store.load();
-
 	Ext.applyIf(me, {
 	    title: "Task viewer: " + task.desc,
 	    width: 800,
@@ -41,6 +39,7 @@
 	    layout: 'fit',
 	    items: {
 		xtype: 'gridpanel',
+		features: [ {ftype: 'selectable'}],
 		store: store,
 		stateful: false,
 		border: false,
@@ -51,18 +50,19 @@
 		invalidateScrollerOnRefresh: false,
 		viewConfig: {
 		    trackOver: false,
-		    stripeRows: false,
-		    emptyText: 'Log is empty.'
+		    stripeRows: false
 		},
 		hideHeaders: true,
 		columns: [ 
-		    { header: "Line", dataIndex: 'n', width: 50 },
+		    //{ header: "Line", dataIndex: 'n', width: 50 },
 		    { header: "Text", dataIndex: 't', flex: 1 } 
 		]
 	    }
         });
 
         me.callParent();
+
+	store.guaranteeRange(0, store.pageSize - 1);
     }
 });
 




More information about the pve-devel mailing list