[pve-devel] [PATCH manager 3/4] spice: Add enhancements to VM Options panel

Aaron Lauterer a.lauterer at proxmox.com
Tue Sep 17 10:28:44 CEST 2019



On 9/16/19 2:56 PM, Christian Ebner wrote:
> 
>> On September 16, 2019 2:44 PM Stefan Reiter <s.reiter at proxmox.com> wrote:
>>
>>   
>>> +    render_spice_enhancements: function(value) {
>>> +	if (!value) {
>>> +	    return Proxmox.Utils.disabledText;
>>> +	}
>>> +	var props = PVE.Parser.parsePropertyString(value);
>>> +	if (Ext.Object.isEmpty(props)) {
>>> +	    return Proxmox.Utils.disabledText;
>>> +	}
>>> +	var ret = [];
>>> +	if (props.foldersharing === "1") {
>>
>> I don't think '=== "1"' catches all cases here, USBEdit.js for example
>> contains a check like this:
>>
>>     if (/^usb3=(1|on|true)$/.test(data[i])) {
>> 	...
>>     }
>>
>> while our JSONSchema parser even accepts "yes" in addition to the ones
>> above.
>>
>> Maybe a common Regex/helper like "parse_boolean" in JSONSchema.pm would
>> be useful in JS too?
> 
> we have parseBoolean in Parser.js for that which checks for 1|yes|on|true and makes sure upper/lower case is taken into account too.
> 

Thanks for the hint :)




More information about the pve-devel mailing list