[pve-devel] [PATCH manager 3/5] gui: {dc, node}/Summary: choose columns by panel size

Dominik Csapak d.csapak at proxmox.com
Wed Dec 4 13:41:35 CET 2019


instead of viewport size, similar to the guest summary

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/dc/Summary.js   | 16 +++++++---------
 www/manager6/node/Summary.js | 20 +++++++++-----------
 2 files changed, 16 insertions(+), 20 deletions(-)

diff --git a/www/manager6/dc/Summary.js b/www/manager6/dc/Summary.js
index 1b3c72e0..aa460cfa 100644
--- a/www/manager6/dc/Summary.js
+++ b/www/manager6/dc/Summary.js
@@ -10,15 +10,7 @@ Ext.define('PVE.dc.Summary', {
 
     defaults: {
 	padding: 5,
-	plugins: 'responsive',
-	responsiveConfig: {
-	    'width < 1900': {
-		columnWidth: 1
-	    },
-	    'width >= 1900': {
-		columnWidth: 0.5
-	    }
-	}
+	columnWidth: 1,
     },
 
     items: [
@@ -81,6 +73,12 @@ Ext.define('PVE.dc.Summary', {
 	}
     ],
 
+    listeners: {
+	resize: function(panel) {
+	    PVE.Utils.updateColumns(panel);
+	},
+    },
+
     initComponent: function() {
         var me = this;
 
diff --git a/www/manager6/node/Summary.js b/www/manager6/node/Summary.js
index 97d9e0ab..dc66fe2b 100644
--- a/www/manager6/node/Summary.js
+++ b/www/manager6/node/Summary.js
@@ -97,19 +97,12 @@ Ext.define('PVE.node.Summary', {
 	    items: [
 		{
 		    xtype: 'container',
+		    itemId: 'itemcontainer',
 		    layout: 'column',
 		    defaults: {
 			minHeight: 320,
 			padding: 5,
-			plugins: 'responsive',
-			responsiveConfig: {
-			    'width < 1900': {
-				columnWidth: 1
-			    },
-			    'width >= 1900': {
-				columnWidth: 0.5
-			    }
-			}
+			columnWidth: 1
 		    },
 		    items: [
 			{
@@ -145,8 +138,13 @@ Ext.define('PVE.node.Summary', {
 			    fields: ['netin','netout'],
 			    store: rrdstore
 			}
-		    ]
-		}
+		    ],
+		    listeners: {
+			resize: function(panel) {
+			    PVE.Utils.updateColumns(panel);
+			},
+		    },
+		},
 	    ],
 	    listeners: {
 		activate: function() { rstore.startUpdate(); rrdstore.startUpdate(); },
-- 
2.20.1





More information about the pve-devel mailing list