all lists on 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 5/5] ui: GuestStatusView: show distro logo and name in summary header
Date: Fri, 20 Oct 2023 15:31:14 +0200	[thread overview]
Message-ID: <a7f064c8-0ec6-4d84-aebe-4c408f30e22e@proxmox.com> (raw)
In-Reply-To: <20230705111257.759836-6-c.heiss@proxmox.com>

one small comment inline

On 7/5/23 13:12, Christoph Heiss wrote:
> It fits neatly there, is rather unintrusive and yet still visible at
> first sight. It also solves the problem of having to create a bigger
> row, so that the icon is still easily recognisable. At the default
> font-size of 13pt, this really wasn't the case.
> 
> Verified that each supported distro is present in the font and the name
> matches up and tested through all supported distros (including
> 'unmanaged').
> 
> Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
> ---
>   www/manager6/panel/GuestStatusView.js | 19 ++++++++++++++++++-
>   1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/www/manager6/panel/GuestStatusView.js b/www/manager6/panel/GuestStatusView.js
> index ca2f03453..c773f252d 100644
> --- a/www/manager6/panel/GuestStatusView.js
> +++ b/www/manager6/panel/GuestStatusView.js
> @@ -29,6 +29,7 @@ Ext.define('PVE.panel.GuestStatusView', {
>   		success: ({ result }) => {
>   		    view.down('#unprivileged').updateValue(
>   			Proxmox.Utils.format_boolean(result.data.unprivileged));
> +		    view.ostype = result.data.ostype;
>   		},
>   	    });
>   	},
> @@ -166,6 +167,22 @@ Ext.define('PVE.panel.GuestStatusView', {
>   		+ ')';
>   	}
>   
> -	me.setTitle(me.getRecordValue('name') + text);
> +	let title = `<div class="left-aligned">${me.getRecordValue('name') + text}</div>`;
> +
> +	if (me.pveSelNode.data.type === 'lxc' && me.ostype && me.ostype !== 'unmanaged') {
> +	    // Manual mappings for distros with special casing
> +	    const namemap = {
> +		'archlinux': 'Arch Linux',
> +		'nixos': 'NixOS',
> +		'opensuse': 'openSUSE',
> +		'centos': 'CentOS',
> +	    };
> +
> +	    const distro = namemap[me.ostype] ?? Ext.String.capitalize(me.ostype);
> +	    title += `<div class="right-aligned">
> +		<i class="fl-${me.ostype} fl-fw"></i>&nbsp;${distro}</div>`;
> +	}

while in practice it won't make a difference,
we probably want to wrap the distro in an Ext.htmlEncode

we don't allow arbitrary values via the api, but if i edit
the config it simply returns the value, e.g. having

   ostype: <b>test</b>

in the container config leads to bold text here

though i don't think this is a blocker for this series

> +
> +	me.setTitle(title);
>       },
>   });





  reply	other threads:[~2023-10-20 13:31 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
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 [this message]
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=a7f064c8-0ec6-4d84-aebe-4c408f30e22e@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 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