ui: avoid trivial decompression widget, only used once

Currently it was only used once and it had not really any benefit, as
the one thing it did is defining a list of compressors – the
KVComboBox is made such, so that this can be done on definition
directly, no need for inheritance.

Also, if one would think about adopting this more for other similar
selectors: While we have some uses of compressors all over the place,
and most of them are not really coupled to each other, so having a
single widget for them does not make sense.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2023-09-26 17:55:34 +02:00
parent e86862bf27
commit 65704cc2a8
3 changed files with 8 additions and 16 deletions

View File

@ -30,11 +30,9 @@ JSSRC= \
form/CephPoolSelector.js \
form/CephFSSelector.js \
form/ComboBoxSetStoreNode.js \
form/CompressionSelector.js \
form/ContentTypeSelector.js \
form/ControllerSelector.js \
form/DayOfWeekSelector.js \
form/DecompressionSelector.js \
form/DiskFormatSelector.js \
form/DiskStorageSelector.js \
form/FileSelector.js \

View File

@ -1,13 +0,0 @@
Ext.define('PVE.form.DecompressionSelector', {
extend: 'Proxmox.form.KVComboBox',
alias: ['widget.pveDecompressionSelector'],
config: {
deleteEmpty: false,
},
comboItems: [
['__default__', Proxmox.Utils.NoneText],
['lzo', 'LZO'],
['gz', 'GZIP'],
['zst', 'ZSTD'],
],
});

View File

@ -206,12 +206,19 @@ Ext.define('PVE.window.DownloadUrlToStorage', {
},
},
{
xtype: 'pveDecompressionSelector',
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',
},