[pve-devel] [PATCH manager] fix #2435: GUI: LXC summary: Add privileged status and os type

Matthias Heiserer m.heiserer at proxmox.com
Mon Aug 8 13:48:16 CEST 2022


---

I'm a bit unsure about the icons, there are probably better ones, but I couldn't
think of/find any. One alternative for OS type would be the OS logos.

 www/manager6/.lint-incremental        |  0
 www/manager6/panel/GuestStatusView.js | 44 +++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 www/manager6/.lint-incremental

diff --git a/www/manager6/.lint-incremental b/www/manager6/.lint-incremental
new file mode 100644
index 00000000..e69de29b
diff --git a/www/manager6/panel/GuestStatusView.js b/www/manager6/panel/GuestStatusView.js
index 8db1f492..96e9adea 100644
--- a/www/manager6/panel/GuestStatusView.js
+++ b/www/manager6/panel/GuestStatusView.js
@@ -11,6 +11,30 @@ Ext.define('PVE.panel.GuestStatusView', {
 	};
     },
 
+    controller: {
+	xclass: 'Ext.app.ViewController',
+
+	init: function(view) {
+	    const nodename = view.pveSelNode.get("node");
+	    const id = view.pveSelNode.get("vmid");
+	    const me = this;
+	    Proxmox.Utils.API2Request({
+		url: `/api2/extjs/nodes/${nodename}/lxc/${id}/config`,
+		waitMsgTarget: view,
+		method: 'GET',
+		success: function(response) {
+		    const ostype = response.result.data.ostype;
+		    const label = me.lookup("ostype").getComponent('label');
+		    label.update(Ext.apply(label.data, {
+			usage: ostype,
+		    }));
+		    const unprivileged = response.result.data.unprivileged;
+		    me.lookup('privileged').updateValue(!unprivileged);
+		},
+	    });
+	},
+    },
+
     layout: {
 	type: 'vbox',
 	align: 'stretch',
@@ -58,6 +82,26 @@ Ext.define('PVE.panel.GuestStatusView', {
 	    },
 	    printBar: false,
 	},
+	{
+	    title: gettext('OS type'),
+	    printBar: false,
+	    reference: 'ostype',
+	    cbind: {
+		hidden: '{isQemu}',
+		disabled: '{isQemu}',
+	    },
+	    iconCls: 'fa fa-mouse-pointer fa-fw',
+	},
+	{
+	    title: gettext('Privileged'),
+	    printBar: false,
+	    reference: 'privileged',
+	    cbind: {
+		hidden: '{isQemu}',
+		disabled: '{isQemu}',
+	    },
+	    iconCls: 'fa fa-user-circle-o fa-fw',
+	},
 	{
 	    xtype: 'box',
 	    height: 15,
-- 
2.30.2





More information about the pve-devel mailing list