public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Christoph Heiss <c.heiss@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager v2 4/5] ui: GuestStatusView: show privileged status as new row
Date: Fri, 20 Oct 2023 15:27:36 +0200	[thread overview]
Message-ID: <54d4c5b7-ebd9-4e0d-b789-1669455b059e@proxmox.com> (raw)
In-Reply-To: <20230705111257.759836-5-c.heiss@proxmox.com>

one small comment inline

On 7/5/23 13:12, Christoph Heiss wrote:
> 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>
> ---
>   www/manager6/panel/GuestStatusView.js | 32 +++++++++++++++++++++++++++
>   1 file changed, 32 insertions(+)
> 
> diff --git a/www/manager6/panel/GuestStatusView.js b/www/manager6/panel/GuestStatusView.js
> index 8db1f492c..ca2f03453 100644
> --- a/www/manager6/panel/GuestStatusView.js
> +++ b/www/manager6/panel/GuestStatusView.js
> @@ -11,6 +11,29 @@ Ext.define('PVE.panel.GuestStatusView', {
>   	};
>       },
>   
> +    controller: {
> +	xclass: 'Ext.app.ViewController',
> +
> +	init: view => {

while this works, it's a rather unusual use for us

normally we use the standard 'function(view) {}' syntax
the advantage of that is that the 'this' object then
is the controller

if someone wants to use the controller in the future and starts
using 'this' it won't work with the arrow syntax (it will be undefined)

> +	    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,





  reply	other threads:[~2023-10-20 13:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05 11:12 [pve-devel] [PATCH font-logos/manager v2 0/5] fix #2435: lxc: show distro and privileged status in summary Christoph Heiss
2023-07-05 11:12 ` [pve-devel] [PATCH font-logos v2 1/5] d/install: fix typo in css install path Christoph Heiss
2023-07-05 11:12 ` [pve-devel] [PATCH font-logos v2 2/5] css: fix missing `@` for font-face rule Christoph Heiss
2023-07-05 11:12 ` [pve-devel] [PATCH manager v2 3/5] pveproxy, ui, d/control: add font-logos Christoph Heiss
2023-07-05 11:12 ` [pve-devel] [PATCH manager v2 4/5] ui: GuestStatusView: show privileged status as new row Christoph Heiss
2023-10-20 13:27   ` Dominik Csapak [this message]
2023-07-05 11:12 ` [pve-devel] [PATCH manager v2 5/5] ui: GuestStatusView: show distro logo and name in summary header Christoph Heiss
2023-10-20 13:31   ` Dominik Csapak
2023-10-11 14:41 ` [pve-devel] [PATCH font-logos/manager v2 0/5] fix #2435: lxc: show distro and privileged status in summary Christoph Heiss
2023-10-20 13:33 ` Dominik Csapak
2023-10-23 15:32   ` [pve-devel] applied-series: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54d4c5b7-ebd9-4e0d-b789-1669455b059e@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=c.heiss@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal