[pve-devel] [PATCH v2 manager] fix #3301: show currently running QEMU version

Fabian Ebner f.ebner at proxmox.com
Tue Mar 9 10:15:00 CET 2021


in the VM summary page.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

Changes from v1:
    * use a separate field instead of attaching it directly to the
      status.

Put it directly below the Status field, because it feels like they belong
together. OTOH the information might not be as relevant so maybe it should be
further below?

I thought about dynamically hiding the field when the VM is not running, but I
didn't see an easy way in this case (would need to add some new functionality
to the StatusView base class AFAICT). An alternative would be using cbind for
running too, but that's not dynamic. Instead, simply use a renderer that checks
for running.

 www/manager6/panel/GuestStatusView.js | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/www/manager6/panel/GuestStatusView.js b/www/manager6/panel/GuestStatusView.js
index 8dab4c19..acf3b7c5 100644
--- a/www/manager6/panel/GuestStatusView.js
+++ b/www/manager6/panel/GuestStatusView.js
@@ -43,6 +43,24 @@ Ext.define('PVE.panel.GuestStatusView', {
 		return text;
 	    },
 	},
+	{
+	    itemId: 'qemuversion',
+	    xtype: 'pveInfoWidget',
+	    title: gettext('QEMU version'),
+	    iconCls: 'fa fa-info fa-fw',
+	    printBar: false,
+	    multiField: true,
+	    renderer: function(record) {
+		if (record.data.status !== 'running') {
+		    return gettext('not running');
+		}
+		return record.data['running-qemu'] || 'N/A';
+	    },
+	    cbind: {
+		hidden: '{!isQemu}',
+		disabled: '{!isQemu}',
+	    },
+	},
 	{
 	    itemId: 'hamanaged',
 	    iconCls: 'fa fa-heartbeat fa-fw',
-- 
2.20.1






More information about the pve-devel mailing list