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>,
	Aaron Lauterer <a.lauterer@proxmox.com>
Subject: Re: [pve-devel] [PATCH manager v2 3/4] ui utils: add renderer for ceph osd addresses
Date: Mon, 17 Oct 2022 16:29:58 +0200	[thread overview]
Message-ID: <78cd9d64-e1b7-4381-27e0-3de16de124e8@proxmox.com> (raw)
In-Reply-To: <20220706130126.282308-4-a.lauterer@proxmox.com>

overall, i'd like the renderer to be a bit more robust.
a small change in output results in nothing showing at all.

i'd try to parse it as good as possible, but fallback to the 'raw' value
in case it fails. that way the user can at least see what ceph returned

On 7/6/22 15:01, Aaron Lauterer wrote:
> Render the OSD listening addresses a bit nicer and one per line.
> 
> Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
> ---
> I tried to keep it as simple as possible to get each address into its
> own line for easier reading.
> 
> changes since v1: none
> 
>   www/manager6/Utils.js | 12 ++++++++++++
>   1 file changed, 12 insertions(+)
> 
> diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
> index 7ca6a271..6499712f 100644
> --- a/www/manager6/Utils.js
> +++ b/www/manager6/Utils.js
> @@ -1278,6 +1278,18 @@ Ext.define('PVE.Utils', {
>   	return Ext.htmlEncode(first + " " + last);
>       },
>   
> +    // expecting the following format:
> +    // [v2:10.10.10.1:6802/2008,v1:10.10.10.1:6803/2008]
> +    render_ceph_osd_addr: function(value) {
> +	value = value.match(/\[(.*)\]/)[1];
> +	value = value.replaceAll(',', '\n');
> +	let retVal = '';
> +	for (const i of value.matchAll(/^(v[0-9]):(.*):([0-9]*)\/([0-9]*)$/gm)) {
> +	    retVal += `${i[1]}: ${i[2]}:${i[3]}<br>`;
> +	}
> +	return retVal;
> +    },
> +
>       windowHostname: function() {
>   	return window.location.hostname.replace(Proxmox.Utils.IP6_bracket_match,
>               function(m, addr, offset, original) { return addr; });





  reply	other threads:[~2022-10-17 14:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06 13:01 [pve-devel] [PATCH widget-toolkit/manager v2 0/4] Ceph OSD: add detail infos Aaron Lauterer
2022-07-06 13:01 ` [pve-devel] [PATCH widget-toolkit v2 1/4] ObjectGrid: optionally show loading mask on load Aaron Lauterer
2022-10-17 14:29   ` Dominik Csapak
2022-07-06 13:01 ` [pve-devel] [PATCH manager v2 2/4] api ceph osd: add OSD index, metadata and lv-info Aaron Lauterer
2022-10-17 14:29   ` Dominik Csapak
2022-07-06 13:01 ` [pve-devel] [PATCH manager v2 3/4] ui utils: add renderer for ceph osd addresses Aaron Lauterer
2022-10-17 14:29   ` Dominik Csapak [this message]
2022-07-06 13:01 ` [pve-devel] [PATCH manager v2 4/4] ui: osd: add details window Aaron Lauterer
2022-10-17 14:30   ` Dominik Csapak
2022-10-12 12:09 ` [pve-devel] [PATCH widget-toolkit/manager v2 0/4] Ceph OSD: add detail infos Aaron Lauterer
2022-10-17 14:29 ` Dominik Csapak
2022-10-18  9:14   ` Aaron Lauterer
2022-10-19  6:46     ` Dominik Csapak

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=78cd9d64-e1b7-4381-27e0-3de16de124e8@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=a.lauterer@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