On 9/16/19 2:56 PM, Christian Ebner wrote:

On September 16, 2019 2:44 PM Stefan Reiter <s.rei...@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 :)

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to