all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] fix #2435: GUI: LXC summary: Add privileged status and os type
@ 2022-08-08 11:48 Matthias Heiserer
  2022-09-09  6:20 ` Thomas Lamprecht
  0 siblings, 1 reply; 3+ messages in thread
From: Matthias Heiserer @ 2022-08-08 11:48 UTC (permalink / raw)
  To: pve-devel

---

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-16 12:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-08 11:48 [pve-devel] [PATCH manager] fix #2435: GUI: LXC summary: Add privileged status and os type Matthias Heiserer
2022-09-09  6:20 ` Thomas Lamprecht
2022-09-16 12:13   ` Matthias Heiserer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal