mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-26 04:31:08 +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");
|
return gettext("None");
|
||||||
}
|
}
|
||||||
|
|
||||||
let retval = "";
|
|
||||||
let first = true;
|
|
||||||
let parsed = PVE.Parser.parsePropertyString(value);
|
let parsed = PVE.Parser.parsePropertyString(value);
|
||||||
|
return Object.entries(parsed)
|
||||||
Ext.Object.each(parsed, (k, v) => {
|
.map(([k, v]) => k + ": " + Proxmox.Utils.format_size(v * 1024) + "/s")
|
||||||
if (!first) {
|
.join(',');
|
||||||
retval += ", ";
|
|
||||||
}
|
|
||||||
// v is in KiB/s
|
|
||||||
retval += k + ": " + Proxmox.Utils.format_size(v * 1024) + "/s";
|
|
||||||
first = false;
|
|
||||||
});
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
initComponent : function() {
|
initComponent : function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user