[pbs-devel] [PATCH proxmox-backup 2/2] ui: add support for notes on backup groups

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Jul 12 08:32:24 CEST 2021


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 <s.reiter at proxmox.com>
> ---
>  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.





More information about the pbs-devel mailing list