public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Lorenz Stechauner <l.stechauner@proxmox.com>
Subject: Re: [pve-devel] [PATCH v2 manager 3/5] ui/UploadToStorage: add checksum and algorithm
Date: Mon, 2 Aug 2021 16:37:35 +0200	[thread overview]
Message-ID: <af43d23d-b63c-f106-7b51-64e9245ade97@proxmox.com> (raw)
In-Reply-To: <20210722130631.237107-8-l.stechauner@proxmox.com>

comments inline

On 7/22/21 15:06, Lorenz Stechauner wrote:
> Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
> ---
>   www/manager6/window/UploadToStorage.js | 32 ++++++++++++++++++++++++++
>   1 file changed, 32 insertions(+)
> 
> diff --git a/www/manager6/window/UploadToStorage.js b/www/manager6/window/UploadToStorage.js
> index fb9850b3..0b4d991a 100644
> --- a/www/manager6/window/UploadToStorage.js
> +++ b/www/manager6/window/UploadToStorage.js
> @@ -130,6 +130,18 @@ Ext.define('PVE.window.UploadToStorage', {
>   	    vm.set('size', (fileInput.files[0] && Proxmox.Utils.format_size(fileInput.files[0].size)) || '-');
>   	    vm.set('mimetype', (fileInput.files[0] && fileInput.files[0].type) || '-');
>   	},
> +
> +	hashChange: function(field) {
> +	    const checksum = Ext.getCmp('downloadUrlChecksum');

since we already have a controller, please use 'reference' instead
of id, and 'this.lookup' instead of Ext.getCmp

> +	    if (field.getValue() === '__default__') {

the second parameter of the change event is the value, so you
could omit the call to getValue here..

> +		checksum.setDisabled(true);
> +		checksum.setValue("");
> +		checksum.allowBlank = true;

is this correct? wouldn't it be

checksum.setAllowBlank ?

also why set that in the first place? just leave it
set to 'false'. Disabled fields will not get submitted
or calculated on form validation anyway

> +	    } else {
> +		checksum.setDisabled(false);
> +		checksum.allowBlank = false;
> +	    }
> +	},
>       },
>   
>       items: [
> @@ -184,6 +196,26 @@ Ext.define('PVE.window.UploadToStorage', {
>   			value: '{mimetype}',
>   		    },
>   		},
> +		{
> +		    xtype: 'pveHashAlgorithmSelector',
> +		    name: 'checksum-algorithm',
> +		    fieldLabel: gettext('Hash algorithm'),
> +		    allowBlank: true,
> +		    hasNoneOption: true,
> +		    value: '__default__',
> +		    listeners: {
> +			change: 'hashChange',
> +		    },
> +		},
> +		{
> +		    xtype: 'textfield',
> +		    name: 'checksum',
> +		    fieldLabel: gettext('Checksum'),
> +		    allowBlank: true,
> +		    disabled: true,
> +		    emptyText: gettext('none'),
> +		    id: 'downloadUrlChecksum',
> +		},
>   		{
>   		    xtype: 'progressbar',
>   		    text: 'Ready',
> 





  reply	other threads:[~2021-08-02 14:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 13:06 [pve-devel] [PATCH-SERIES v2 http-server/storage/manager] add checksum and algorithm to iso upload Lorenz Stechauner
2021-07-22 13:06 ` [pve-devel] [PATCH v2 http-server 1/1] anyevent: move unlink from http-server to endpoint Lorenz Stechauner
2021-07-22 13:06 ` [pve-devel] [PATCH v2 storage 1/3] status: move unlink from http-server to enpoint Lorenz Stechauner
2021-07-30 13:13   ` Thomas Lamprecht
2021-07-22 13:06 ` [pve-devel] [PATCH v2 storage 2/3] status: remove sleep(1) in file upload Lorenz Stechauner
2021-07-22 13:06 ` [pve-devel] [PATCH v2 storage 1/1] status: add checksum and algorithm to " Lorenz Stechauner
2021-07-30 13:15   ` Thomas Lamprecht
2021-07-22 13:06 ` [pve-devel] [PATCH v2 manager 1/5] ui: move upload window into UploadToStorage.js Lorenz Stechauner
2021-07-22 13:06 ` [pve-devel] [PATCH v2 manager 2/5] ui: refactor UploadToStorage.js Lorenz Stechauner
2021-08-02 14:34   ` Dominik Csapak
2021-07-22 13:06 ` [pve-devel] [PATCH v2 manager 3/5] ui/UploadToStorage: add checksum and algorithm Lorenz Stechauner
2021-08-02 14:37   ` Dominik Csapak [this message]
2021-07-22 13:06 ` [pve-devel] [PATCH v2 manager 4/5] ui/UploadToStorage: add TaskViewer Lorenz Stechauner
2021-07-22 13:06 ` [pve-devel] [PATCH v2 manager 5/5] ui/UplaodToStorage: check file extension Lorenz Stechauner
2021-08-02 14:40   ` Dominik Csapak
2021-07-30 13:19 ` [pve-devel] [PATCH-SERIES v2 http-server/storage/manager] add checksum and algorithm to iso upload Thomas Lamprecht

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=af43d23d-b63c-f106-7b51-64e9245ade97@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=l.stechauner@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