Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
const filename = filenameField.getValue();
filenameField.setDisabled(true);
const filename = filenameField.getValue();
filenameField.setDisabled(true);
+ const algorithmField = form.findField('checksum-algorithm');
+ algorithmField.setDisabled(true);
+ if (algorithmField.getValue() !== '__default__') {
+ fd.append("checksum-algorithm", algorithmField.getValue());
+
+ const checksumField = form.findField('checksum');
+ fd.append("checksum", checksumField.getValue());
+ checksumField.setDisabled(true);
+ }
+
fd.append("filename", file, filename);
pbar.setVisible(true);
fd.append("filename", file, filename);
pbar.setVisible(true);
vm.set('size', (fileInput.files[0] && Proxmox.Utils.format_size(fileInput.files[0].size)) || '-');
vm.set('mimetype', (fileInput.files[0] && fileInput.files[0].type) || '-');
},
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, value) {
+ const checksum = this.lookup('downloadUrlChecksum');
+ if (value === '__default__') {
+ checksum.setDisabled(true);
+ checksum.setValue("");
+ } else {
+ checksum.setDisabled(false);
+ }
+ },
value: '{mimetype}',
},
},
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: false,
+ disabled: true,
+ emptyText: gettext('none'),
+ reference: 'downloadUrlChecksum',
+ },
{
xtype: 'progressbar',
text: 'Ready',
{
xtype: 'progressbar',
text: 'Ready',