[pve-devel] [PATCH manager 05/17] get storage info from /version api call in gui

Emmanuel Kasper e.kasper at proxmox.com
Wed Aug 30 13:20:20 CEST 2017


> +    setStorageFormats: function(types) {
> +	/*jslint confusion: true*/
> +	// format/select are functions elsewhere
> +	var me = this;
> +	var type,sf;
> +	me.storageformats = {};
> +	for (type in types) {
> +	    if (types.hasOwnProperty(type)) {
> +		var st = types[type];
> +		var format = {
> +		    content: st.contents,
> +		    formats: ['raw'],
> +		    defaultFormat: 'raw',
> +		    selecting: st.select === 1
> +		};

selecting: st.select ===1

has two problems
A ) AFAICS, the select property is never sent from the API call, so the
parameter is never set

looking from the way we return the info from /version

	foreach my $type (@$storagetypes) {
	    my $plugin = PVE::Storage::Plugin->lookup($type);
	    $storages->{$type} = $plugin->plugindata();
	}

	$res->{storagetypes} = $storages;

this parameter should come from plugindata() but does plugindata()
return such info  ?

B) maybe you wanted to write:

> +		    select: st.select === 1
> +		};

(select instead of selecting)

as the default storageProperties object has this format
{
		formats: {
		    'qcow2':1,
		    'raw':1,
		    'vmdk':1
		},
		defaultFormat: 'raw',
		select: 0
	    };
also in DiskStorageSelector
hdfilesel.setDisabled(!format.select || me.hideSelection);


currently these issues prevent to create a disk image on a iscsi lun





More information about the pve-devel mailing list