]> git.proxmox.com Git - pve-manager.git/commit
ui: parse VM network: support floats without trailing zero
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 21 Mar 2024 09:40:35 +0000 (10:40 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 21 Mar 2024 09:50:04 +0000 (10:50 +0100)
commitb120875cc4339b7c9358fe8019817f60960e7edf
tree942ebb4e88058d04cede22fdbc15708786be050a
parent24d60df3da63c052372a42446e884e8504bec02a
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 <t.lamprecht@proxmox.com>
www/manager6/Parser.js