public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager] fix #4873: use last used backup storage for the storage selector
Date: Fri, 26 Jan 2024 14:27:43 +0100	[thread overview]
Message-ID: <5b1df1d2-c9b9-4c79-8862-895eee4b3452@proxmox.com> (raw)
In-Reply-To: <20231120141852.1105425-1-d.csapak@proxmox.com>

Am 20.11.23 um 15:18 schrieb Dominik Csapak:
> for this, we invent the 'storageStateId' parameter that is undeifned by
> default, but if set, the storage selector saves it's value on every
> change there and on initial load (when no value is set from outside)
> loads it from there and uses that as its value.
> 
> for now only use it for the selection of backup storages namely in:
> * backup grid
> * "backup now" edit window
> * backup job edit window
> 
> in the future we could use that to have a 'last used disk image' or
> 'last used iso' storage too if this approach fits
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>

Tested-by: Fiona Ebner <f.ebner@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>

> ---
> 
> the backup job edit is a bit weird and probably warrants a bit of
> discussion, since the interaction when editing an existing job is imho
> unexpected:
> 
>  1. select backup storage X in backup grid
>  2. edit a backup job where storage Y is selected (that happens
>     correctly) but don't touch the storage field
>  3. now storage Y is the last used and selected on the grids
> 

Agreed, but it's still more convenient with the patch than without.

Could we maybe only enable the state update from the second change event
onward? AFAIU, there will always be one change event to set the initial
value and for that we could simply not update the state.

> diff --git a/www/manager6/form/StorageSelector.js b/www/manager6/form/StorageSelector.js
> index 872bc1ab..0a43712f 100644
> --- a/www/manager6/form/StorageSelector.js
> +++ b/www/manager6/form/StorageSelector.js
> @@ -147,6 +147,15 @@ Ext.define('PVE.form.StorageSelector', {
>  	me.reloadStorageList();
>      },
>  
> +    listeners: {
> +	change: function(selector, storage) {
> +	    if (selector.storageStateId){

eslint complains here because of missing space

> +		let sp = Ext.state.Manager.getProvider();
> +		sp.set(selector.storageStateId, storage);

Is this state fully global? If yes, is limiting it to instances of the
'PVE.form.StorageSelector' xtype possible/feasible?

> +	    }
> +	},
> +    },
> +
>      initComponent: function() {
>  	var me = this;
>  




      reply	other threads:[~2024-01-26 13:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 14:18 Dominik Csapak
2024-01-26 13:27 ` Fiona Ebner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b1df1d2-c9b9-4c79-8862-895eee4b3452@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal