From: Thomas Lamprecht Date: Thu, 21 Mar 2024 09:40:35 +0000 (+0100) Subject: ui: parse VM network: support floats without trailing zero X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=b120875cc4339b7c9358fe8019817f60960e7edf;p=pve-manager.git ui: parse VM network: support floats without trailing zero While on simple cases the frontend will translate a `.5` to `0.5` the backend really doesn't care and takes either. And it seems that editing from an exiting `0.5` to `.75` will often cause this to submitted as is. Independent of how such a value comes into the config, it broke parsing the network rate property in the UI, where we assumed that there's always a digit on the left side of the floating point separator. Simply extend the regex to allow parsing those floats that directly start with a separator too. Link: https://forum.proxmox.com/threads/143525/ Signed-off-by: Thomas Lamprecht --- diff --git a/www/manager6/Parser.js b/www/manager6/Parser.js index bc6a4338..debf9d23 100644 --- a/www/manager6/Parser.js +++ b/www/manager6/Parser.js @@ -121,7 +121,7 @@ Ext.define('PVE.Parser', { } } else if ((match_res = p.match(/^bridge=(\S+)$/)) !== null) { res.bridge = match_res[1]; - } else if ((match_res = p.match(/^rate=(\d+(\.\d+)?)$/)) !== null) { + } else if ((match_res = p.match(/^rate=(\d+(\.\d+)?|\.\d+)$/)) !== null) { res.rate = match_res[1]; } else if ((match_res = p.match(/^tag=(\d+(\.\d+)?)$/)) !== null) { res.tag = match_res[1];