From: Lorenz Stechauner <l.stechauner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 4/5] ui/UploadToStorage.js: add checksum and algorithm
Date: Tue, 20 Jul 2021 13:51:46 +0200 [thread overview]
Message-ID: <20210720115147.1988565-8-l.stechauner@proxmox.com> (raw)
In-Reply-To: <20210720115147.1988565-1-l.stechauner@proxmox.com>
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
---
www/manager6/window/UploadToStorage.js | 42 ++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/www/manager6/window/UploadToStorage.js b/www/manager6/window/UploadToStorage.js
index 75423b0f..ca89692e 100644
--- a/www/manager6/window/UploadToStorage.js
+++ b/www/manager6/window/UploadToStorage.js
@@ -83,6 +83,16 @@ Ext.define('PVE.window.UploadToStorage', {
fd.append("new-filename", field.getValue());
field.setDisabled(true);
+ field = form.findField('checksum-algorithm');
+ field.setDisabled(true);
+ if (field.getValue() !== '__default__') {
+ fd.append("checksum-algorithm", field.getValue());
+
+ field = form.findField('checksum');
+ fd.append("checksum", field.getValue());
+ field.setDisabled(true);
+ }
+
field = form.findField('filename');
const file = field.fileInputEl.dom;
fd.append("filename", file.files[0]);
@@ -139,6 +149,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');
+ if (field.getValue() === '__default__') {
+ checksum.setDisabled(true);
+ checksum.setValue("");
+ checksum.allowBlank = true;
+ } else {
+ checksum.setDisabled(false);
+ checksum.allowBlank = false;
+ }
+ },
},
items: [
@@ -193,6 +215,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',
--
2.30.2
next prev parent reply other threads:[~2021-07-20 11:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-20 11:51 [pve-devel] [PATCH-SERIES http-server/storage/manager] add checksum and algorithm to iso upload Lorenz Stechauner
2021-07-20 11:51 ` [pve-devel] [PATCH http-server] anyevent: move unlink from http-server to endpoint Lorenz Stechauner
2021-07-20 13:23 ` Thomas Lamprecht
2021-07-20 11:51 ` [pve-devel] [PATCH storage 1/3] status: " Lorenz Stechauner
2021-07-20 13:31 ` Thomas Lamprecht
2021-07-20 11:51 ` [pve-devel] [PATCH storage 2/3] status: add new-filename to upload Lorenz Stechauner
2021-07-20 13:27 ` Thomas Lamprecht
2021-07-20 19:15 ` Thomas Lamprecht
2021-07-20 11:51 ` [pve-devel] [PATCH storage 3/3] status: add checksum and algorithm to file upload Lorenz Stechauner
2021-07-20 13:40 ` Thomas Lamprecht
2021-07-20 11:51 ` [pve-devel] [PATCH manager 2/5] ui: move upload window into UploadToStorage.js Lorenz Stechauner
2021-07-20 11:51 ` [pve-devel] [PATCH manager 3/5] ui: refactor UploadToStorage.js Lorenz Stechauner
2021-07-20 11:51 ` Lorenz Stechauner [this message]
2021-07-20 11:51 ` [pve-devel] [PATCH manager 5/5] ui/UploadToStorage.js: add TaskViewer Lorenz Stechauner
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=20210720115147.1988565-8-l.stechauner@proxmox.com \
--to=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