From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id B244F748A7 for ; Mon, 19 Apr 2021 13:01:24 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3814A14A6A for ; Mon, 19 Apr 2021 13:00:54 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 7DEFB144CC for ; Mon, 19 Apr 2021 13:00:50 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 486C045B11 for ; Mon, 19 Apr 2021 13:00:50 +0200 (CEST) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Mon, 19 Apr 2021 13:00:47 +0200 Message-Id: <20210419110048.20791-8-d.csapak@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210419110048.20791-1-d.csapak@proxmox.com> References: <20210419110048.20791-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.159 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH manager 3/4] ui: Utils: use updateColumns from widget-toolkit X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 11:01:24 -0000 it was moved there Signed-off-by: Dominik Csapak --- www/manager6/Utils.js | 30 ------------------------------ www/manager6/dc/Summary.js | 4 ++-- www/manager6/node/Summary.js | 4 ++-- www/manager6/panel/GuestSummary.js | 4 ++-- 4 files changed, 6 insertions(+), 36 deletions(-) diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js index 48d94a64..87366842 100644 --- a/www/manager6/Utils.js +++ b/www/manager6/Utils.js @@ -1614,36 +1614,6 @@ Ext.define('PVE.Utils', { } }, - updateColumns: function(container) { - let mode = Ext.state.Manager.get('summarycolumns') || 'auto'; - let factor; - if (mode !== 'auto') { - factor = parseInt(mode, 10); - if (Number.isNaN(factor)) { - factor = 1; - } - } else { - factor = container.getSize().width < 1400 ? 1 : 2; - } - - if (container.oldFactor === factor) { - return; - } - - let items = container.query('>'); // direct childs - factor = Math.min(factor, items.length); - container.oldFactor = factor; - - items.forEach((item) => { - item.columnWidth = 1 / factor; - }); - - // we have to update the layout twice, since the first layout change - // can trigger the scrollbar which reduces the amount of space left - container.updateLayout(); - container.updateLayout(); - }, - forEachCorosyncLink: function(nodeinfo, cb) { let re = /(?:ring|link)(\d+)_addr/; Ext.iterate(nodeinfo, (prop, val) => { diff --git a/www/manager6/dc/Summary.js b/www/manager6/dc/Summary.js index 67d5e95b..e845c261 100644 --- a/www/manager6/dc/Summary.js +++ b/www/manager6/dc/Summary.js @@ -75,7 +75,7 @@ Ext.define('PVE.dc.Summary', { listeners: { resize: function(panel) { - PVE.Utils.updateColumns(panel); + Proxmox.Utils.updateColumns(panel); }, }, @@ -291,7 +291,7 @@ Ext.define('PVE.dc.Summary', { if (key !== 'summarycolumns') { return; } - PVE.Utils.updateColumns(me); + Proxmox.Utils.updateColumns(me); }); rstore.startUpdate(); diff --git a/www/manager6/node/Summary.js b/www/manager6/node/Summary.js index ccddd5a0..1c93ef04 100644 --- a/www/manager6/node/Summary.js +++ b/www/manager6/node/Summary.js @@ -161,7 +161,7 @@ Ext.define('PVE.node.Summary', { ], listeners: { resize: function(panel) { - PVE.Utils.updateColumns(panel); + Proxmox.Utils.updateColumns(panel); }, }, }, @@ -186,7 +186,7 @@ Ext.define('PVE.node.Summary', { if (key !== 'summarycolumns') { return; } - PVE.Utils.updateColumns(me.getComponent('itemcontainer')); + Proxmox.Utils.updateColumns(me.getComponent('itemcontainer')); }); }, }); diff --git a/www/manager6/panel/GuestSummary.js b/www/manager6/panel/GuestSummary.js index 9dc69913..7061b1a4 100644 --- a/www/manager6/panel/GuestSummary.js +++ b/www/manager6/panel/GuestSummary.js @@ -120,7 +120,7 @@ Ext.define('PVE.qemu.Summary', { items: items, listeners: { resize: function(container) { - PVE.Utils.updateColumns(container); + Proxmox.Utils.updateColumns(container); }, }, }, @@ -137,7 +137,7 @@ Ext.define('PVE.qemu.Summary', { if (key !== 'summarycolumns') { return; } - PVE.Utils.updateColumns(me.getComponent('itemcontainer')); + Proxmox.Utils.updateColumns(me.getComponent('itemcontainer')); }); }, }); -- 2.20.1