[pve-devel] [PATCH v2 12/12] ui: qemu: hardware: add eject button for cdroms

Daniel Herzig d.herzig at proxmox.com
Fri Jan 24 08:35:02 CET 2025


Hi Friedrich,

thanks for looking into this, this comes right in time, as I've so far
finished v3 of the backend-part.

Friedrich Weber <f.weber at proxmox.com> writes:

> Hi, I have two small things that I noticed skimming the series (inline).
>
> On 13/01/2025 09:56, Daniel Herzig wrote:
>> Eject by setting file to none.
>> 
>> Signed-off-by: Daniel Herzig <d.herzig at proxmox.com>
>> ---
>>  www/manager6/qemu/HardwareView.js | 43 +++++++++++++++++++++++++++++++
>>  1 file changed, 43 insertions(+)
>> 
>> diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
>> index 59e670db..5d1c18a5 100644
>> --- a/www/manager6/qemu/HardwareView.js
>> +++ b/www/manager6/qemu/HardwareView.js
>> @@ -538,6 +538,45 @@ Ext.define('PVE.qemu.HardwareView', {
>>  	    apiurl: '/api2/extjs/' + baseurl,
>>  	});
>>  
>> +	let eject_btn = new Proxmox.button.Button({
>> +	    text: gettext('Eject'),
>> +	    disabled: true,
>> +	    selModel: sm,
>> +	    RESTMethod: 'POST',
>> +	    confirmMsg: function(rec) {
>> +		let warn = gettext("Are you sure you want to eject '{0}' ?");
>> +		let isofile = rec.data.value.split(",")[0];
>
> Not a frontend expert, but it might be nicer to use something like
> PVE.Parser.parsePropertyString to retrieve the ISO name here, instead of
> manually splitting the string.
>
Perfect, will switch to using this.

>> +		let msg = Ext.String.format(warn, isofile);
>> +		return msg;
>
> This should be html-encoded before displaying, e.g. using Ext.htmlEncode.

Thanks for this one as well!




More information about the pve-devel mailing list