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 C7E99753CA for ; Mon, 12 Jul 2021 08:32:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id BF0FD1119A for ; Mon, 12 Jul 2021 08:32:46 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 504C01118B for ; Mon, 12 Jul 2021 08:32:46 +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 1FA21403AA for ; Mon, 12 Jul 2021 08:32:46 +0200 (CEST) Message-ID: <0e99faa7-52ea-39de-1e04-531c3da7d50d@proxmox.com> Date: Mon, 12 Jul 2021 08:32:24 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Thunderbird/90.0 Content-Language: en-US To: Proxmox Backup Server development discussion , Stefan Reiter References: <20210708144528.1405534-1-s.reiter@proxmox.com> <20210708144528.1405534-2-s.reiter@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20210708144528.1405534-2-s.reiter@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.786 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.631 Looks like a legit reply (A) 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 proxmox-backup 2/2] ui: add support for notes on backup groups 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, 12 Jul 2021 06:32:46 -0000 On 08.07.21 16:45, Stefan Reiter wrote: > Currently done a little bit hacky in a seperate API call following the > initial list_snapshots, as we previously didn't call list_groups at all > and instead calculated the groups from the snapshots. > > This calls it async and updates the view with group comments when data > arrives. The editor is simply reused with the 'group-notes' API call, > since the semantics are the same. > > Signed-off-by: Stefan Reiter > --- > www/datastore/Content.js | 59 ++++++++++++++++++++++++++++++++-------- > 1 file changed, 48 insertions(+), 11 deletions(-) > > diff --git a/www/datastore/Content.js b/www/datastore/Content.js > index 101763aa..29d58fc3 100644 > --- a/www/datastore/Content.js > +++ b/www/datastore/Content.js > @@ -125,6 +125,29 @@ Ext.define('PBS.DataStoreContent', { > return groups; > }, > > + updateGroupNotes: function(view) { > + Proxmox.Utils.API2Request({ > + url: `/api2/extjs/admin/datastore/${view.datastore}/groups`, > + method: 'GET', > + success: function(response) { > + let groups = response.result.data; > + let map = {}; > + for (const group of groups) { > + map[`${group["backup-type"]}/${group["backup-id"]}`] = group["comment"]; eslint throws an error on this, as the rules enforce that it'd be written in dot notation: group.comment Please actually use the build system before sending such things, a simple `make install` in the www/ folder would have shown that this cannot work... Fixed in a followup, rewrote that whole function to async while at it.