[pve-devel] [PATCH manager 2/3] Hardware View: Add GUI for importdisk

Dominic Jäger d.jaeger at proxmox.com
Thu Jul 30 12:20:19 CEST 2020


Thank you for taking a look!

> > +	if (me.isImport) {
> > +	    // These keys & values are accepted by the API as they are
> > +	    let simple = ['backup', 'ssd', 'iothread', 'cache'];
> > +	    let burst = ['mbps_rd', 'mbps_wr', 'iops_rd', 'iops_wr'];
> > +	    burst = burst.concat(burst.map(x => `${x}_max`));
> > +	    let available = simple.concat(burst);
> > +	    let addValues = key => `${key}=${values[key]}`;
> > +	    let selectedKeys = x => values[x];
> > +	    let options = available.filter(selectedKeys).map(addValues).join();
> > +	    // These need modification for the API
> > +	    options += values.discard ? ',discard=on' : '';
> > +	    options += values.noreplicate ? ',replicate=0' : '';
> > +	    params.device_options = options;
> 
> One or two newlines in the above block would be nice to make the distinction between the logical blocks more obvious.
Done.
> 
> > +	    if (me.isImport) selector.storageLabel = 'Target storage';
> 
> this should be a `gettext('Target storage')` so it can be translated.
Done.

> for consistency I would not change the title and instead set the following:
> me.subject = gettext('Import Disk'),
Done.






More information about the pve-devel mailing list