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 F401A60685 for ; Wed, 2 Sep 2020 13:04:23 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 10E13101EC for ; Wed, 2 Sep 2020 13:03:53 +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 8E2E11010E for ; Wed, 2 Sep 2020 13:03:48 +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 5862A449D5 for ; Wed, 2 Sep 2020 13:03:48 +0200 (CEST) From: Fabian Ebner To: pve-devel@lists.proxmox.com Date: Wed, 2 Sep 2020 13:03:29 +0200 Message-Id: <20200902110337.25004-7-f.ebner@proxmox.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200902110337.25004-1-f.ebner@proxmox.com> References: <20200902110337.25004-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.045 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [me.storage, me.sm, me.store] Subject: [pve-devel] [PATCH manager 06/14] turn nodename, storage, sm into object variables 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: Wed, 02 Sep 2020 11:04:24 -0000 so they can be used and specified in derived classes. Signed-off-by: Fabian Ebner --- www/manager6/storage/ContentView.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js index 45e40074..e7c3bc70 100644 --- a/www/manager6/storage/ContentView.js +++ b/www/manager6/storage/ContentView.js @@ -360,15 +360,21 @@ Ext.define('PVE.storage.ContentView', { initComponent : function() { var me = this; - var nodename = me.pveSelNode.data.node; - if (!nodename) { - throw "no node name specified"; + if (!me.nodename) { + me.nodename = me.pveSelNode.data.node; + if (!me.nodename) { + throw "no node name specified"; + } } + var nodename = me.nodename; - var storage = me.pveSelNode.data.storage; - if (!storage) { - throw "no storage ID specified"; + if (!me.storage) { + me.storage = me.pveSelNode.data.storage; + if (!me.storage) { + throw "no storage ID specified"; + } } + var storage = me.storage; var content = me.content; if (!content) { @@ -376,7 +382,7 @@ Ext.define('PVE.storage.ContentView', { } var baseurl = "/nodes/" + nodename + "/storage/" + storage + "/content"; - var store = Ext.create('Ext.data.Store',{ + var store = me.store = Ext.create('Ext.data.Store', { model: 'pve-storage-content', groupField: 'content', proxy: { @@ -389,7 +395,10 @@ Ext.define('PVE.storage.ContentView', { } }); - var sm = Ext.create('Ext.selection.RowModel', {}); + if (!me.sm) { + me.sm = Ext.create('Ext.selection.RowModel', {}); + } + var sm = me.sm; var reload = function() { store.load(); -- 2.20.1