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 BD90762782 for ; Mon, 13 Jul 2020 14:29:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B17761B543 for ; Mon, 13 Jul 2020 14:28:57 +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 893401B534 for ; Mon, 13 Jul 2020 14:28:56 +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 557FC43247 for ; Mon, 13 Jul 2020 14:28:56 +0200 (CEST) From: Aaron Lauterer To: pbs-devel@lists.proxmox.com Reply-To: Proxmox Backup Server development discussion References: <20200713120347.25811-1-a.lauterer@proxmox.com> Message-ID: Date: Mon, 13 Jul 2020 14:28:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200713120347.25811-1-a.lauterer@proxmox.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.000 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) 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: Re: [pbs-devel] [PATCH] ui: datastore: Add basic expand/collapse all button X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jul 2020 12:29:27 -0000 ignore this version as it will not handle situations with only some tree items expanded very well. v2 is underway. On 7/13/20 2:03 PM, Aaron Lauterer wrote: > The parent component to the tree grid (tab.panel) does not understand > the Ext.panel.Tool class which would usually be used in such a > situation. > > As a workaround a simple button (right aligned) in the tbar section has > to do the job for now. > > Signed-off-by: Aaron Lauterer > --- > www/DataStoreContent.js | 27 +++++++++++++++++++++++++-- > 1 file changed, 25 insertions(+), 2 deletions(-) > > diff --git a/www/DataStoreContent.js b/www/DataStoreContent.js > index a29436fc..cac0b481 100644 > --- a/www/DataStoreContent.js > +++ b/www/DataStoreContent.js > @@ -47,6 +47,8 @@ Ext.define('PBS.DataStoreContent', { > > title: gettext('Content'), > > + isExpanded: false, > + > controller: { > xclass: 'Ext.app.ViewController', > > @@ -321,7 +323,22 @@ Ext.define('PBS.DataStoreContent', { > 'backup-time': (time.getTime()/1000).toFixed(0), > 'backup-type': type, > }).show(); > - } > + }, > + > + expandCollapseAll: function (button) { > + let me = this; > + let view = me.getView(); > + > + if (me.isExpanded) { > + view.collapseAll(); > + me.isExpanded = false; > + button.setText(gettext('Expand All')); > + } else { > + view.expandAll(); > + me.isExpanded = true; > + button.setText(gettext('Collapse All')); > + } > + }, > }, > > columns: [ > @@ -446,6 +463,12 @@ Ext.define('PBS.DataStoreContent', { > enableFn: function(record) { > return !!record.data.leaf && record.size !== null && record.data.files.some(el => el.filename.endsWith('pxar.didx')); > }, > - } > + }, > + '->', > + { > + xtype: "proxmoxButton", > + text: gettext('Expand All'), > + handler: 'expandCollapseAll', > + }, > ], > }); >