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"),
});
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',
+ },
+ },
],
},
{
if (!me.storage) {
throw "no storage ID specified";
}
-
me.callParent();
},
});