[pve-devel] [PATCH pve-manager 1/2] ui: qemu: hardware: add new memory format support

Alexandre Derumier aderumier at odiso.com
Mon Feb 20 17:27:28 CET 2023


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 www/manager6/qemu/HardwareView.js | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/www/manager6/qemu/HardwareView.js b/www/manager6/qemu/HardwareView.js
index af35a980..0b17ef0d 100644
--- a/www/manager6/qemu/HardwareView.js
+++ b/www/manager6/qemu/HardwareView.js
@@ -77,11 +77,17 @@ Ext.define('PVE.qemu.HardwareView', {
 		renderer: function(value, metaData, record, ri, ci, store, pending) {
 		    var res = '';
 
-		    var max = me.getObjectValue('memory', 512, pending);
+		    let memory = me.getObjectValue('memory', undefined, pending);
+		    let props = PVE.Parser.parsePropertyString(memory, 'current');
+		    let current = 512;
+		    if (props.current) {
+			current = props.current;
+		    }
+
 		    var balloon = me.getObjectValue('balloon', undefined, pending);
 		    var shares = me.getObjectValue('shares', undefined, pending);
 
-		    res = Proxmox.Utils.format_size(max*1024*1024);
+		    res = Proxmox.Utils.format_size(current*1024*1024);
 
 		    if (balloon !== undefined && balloon > 0) {
 			res = Proxmox.Utils.format_size(balloon*1024*1024) + "/" + res;
@@ -92,6 +98,13 @@ Ext.define('PVE.qemu.HardwareView', {
 		    } else if (balloon === 0) {
 			res += ' [balloon=0]';
 		    }
+		    if (props.max) {
+			res += ' [max=' + Proxmox.Utils.format_size(props.max*1024*1024) +']';
+		    }
+		    if (props.virtio) {
+			res += ' [virtio=' + props.virtio +']';
+		    }
+
 		    return res;
 		},
 	    },
-- 
2.30.2





More information about the pve-devel mailing list