]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: container guest status: show privileged status as new row
authorChristoph Heiss <c.heiss@proxmox.com>
Wed, 5 Jul 2023 11:12:48 +0000 (13:12 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 23 Oct 2023 15:27:14 +0000 (17:27 +0200)
As that info is not available through the store (which stores the
status), it must be fetched separately.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
 [ TL: rework subject and avoid arror-fn for controller to keep `this`
   working, as reviewed by Dominik ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/panel/GuestStatusView.js

index 8db1f492c37330f81648170bdb4b8fa5a9169135..9ecff7bec47855a05e02966c31707eeaccc9d0f8 100644 (file)
@@ -11,6 +11,29 @@ Ext.define('PVE.panel.GuestStatusView', {
        };
     },
 
+    controller: {
+       xclass: 'Ext.app.ViewController',
+
+       init: function(view) {
+           if (view.pveSelNode.data.type !== 'lxc') {
+               return;
+           }
+
+           const nodename = view.pveSelNode.data.node;
+           const vmid = view.pveSelNode.data.vmid;
+
+           Proxmox.Utils.API2Request({
+               url: `/api2/extjs/nodes/${nodename}/lxc/${vmid}/config`,
+               waitMsgTargetView: view,
+               method: 'GET',
+               success: ({ result }) => {
+                   view.down('#unprivileged').updateValue(
+                       Proxmox.Utils.format_boolean(result.data.unprivileged));
+               },
+           });
+       },
+    },
+
     layout: {
        type: 'vbox',
        align: 'stretch',
@@ -58,6 +81,15 @@ Ext.define('PVE.panel.GuestStatusView', {
            },
            printBar: false,
        },
+       {
+           itemId: 'unprivileged',
+           iconCls: 'fa fa-lock fa-fw',
+           title: gettext('Unprivileged'),
+           printBar: false,
+           cbind: {
+               hidden: '{isQemu}',
+           },
+       },
        {
            xtype: 'box',
            height: 15,