mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-25 10:10:14 +00:00
ui dc/options: refactor render_bwlimits
while this /could/ (not benched marked in any way) be slower it operates on so small data sets that this isn't worth it having double the code lines. A map + join is still quite readable and not yet "code golfy" Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
136103b0c9
commit
27af8ed019
@ -60,20 +60,10 @@ Ext.define('PVE.dc.OptionView', {
|
||||
return gettext("None");
|
||||
}
|
||||
|
||||
let retval = "";
|
||||
let first = true;
|
||||
let parsed = PVE.Parser.parsePropertyString(value);
|
||||
|
||||
Ext.Object.each(parsed, (k, v) => {
|
||||
if (!first) {
|
||||
retval += ", ";
|
||||
}
|
||||
// v is in KiB/s
|
||||
retval += k + ": " + Proxmox.Utils.format_size(v * 1024) + "/s";
|
||||
first = false;
|
||||
});
|
||||
|
||||
return retval;
|
||||
return Object.entries(parsed)
|
||||
.map(([k, v]) => k + ": " + Proxmox.Utils.format_size(v * 1024) + "/s")
|
||||
.join(',');
|
||||
},
|
||||
|
||||
initComponent : function() {
|
||||
|
Loading…
Reference in New Issue
Block a user