urlField.validate();
let data = res.result.data;
+
+ let filename = data.filename || "";
+ let compression = '__default__';
+ if (view.content === 'iso') {
+ const matches = filename.match(/^(.+)\.(gz|lzo|zst)$/i);
+ if (matches) {
+ filename = matches[1];
+ compression = matches[2].toLowerCase();
+ }
+ }
+
view.setValues({
- filename: data.filename || "",
+ filename,
+ compression,
size: (data.size && Proxmox.Utils.format_size(data.size)) || gettext("Unknown"),
mimetype: data.mimetype || gettext("Unknown"),
});
{
xtype: 'inputpanel',
border: false,
+ onGetValues: function(values) {
+ if (typeof values.checksum === 'string') {
+ values.checksum = values.checksum.trim();
+ }
+ return values;
+ },
columnT: [
{
xtype: 'fieldcontainer',
change: 'setQueryEnabled',
},
},
+ {
+ xtype: 'proxmoxKVComboBox',
+ name: 'compression',
+ fieldLabel: gettext('Decompression algorithm'),
+ allowBlank: true,
+ hasNoneOption: true,
+ deleteEmpty: false,
+ value: '__default__',
+ comboItems: [
+ ['__default__', Proxmox.Utils.NoneText],
+ ['lzo', 'LZO'],
+ ['gz', 'GZIP'],
+ ['zst', 'ZSTD'],
+ ],
+ cbind: {
+ hidden: get => get('content') !== 'iso',
+ },
+ },
],
},
{
],
initComponent: function() {
- var me = this;
+ var me = this;
if (!me.nodename) {
throw "no node name specified";
if (!me.storage) {
throw "no storage ID specified";
}
-
- me.callParent();
+ me.callParent();
},
});