all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Lukas Wagner" <l.wagner@proxmox.com>
To: "Dominik Csapak" <d.csapak@proxmox.com>, <pdm-devel@lists.proxmox.com>
Subject: Re: [PATCH datacenter-manager v3 8/9] ui: pve: node selector: show maintenance badge with node name
Date: Fri, 28 Aug 2026 14:55:48 +0200	[thread overview]
Message-ID: <DL0LD4F6NSGN.3C5TNOQ9ZGOLP@proxmox.com> (raw)
In-Reply-To: <20260821123201.3035643-9-d.csapak@proxmox.com>

On Fri Aug 21, 2026 at 2:30 PM CEST, Dominik Csapak wrote:
>          columns.push(
>              DataTableColumn::new(tr!("Memory Usage"))
> -                .render(
> -                    |entry: &ClusterNodeIndexResponse| match (entry.mem, entry.maxmem) {
> -                        (Some(mem), Some(maxmem)) => {
> -                            html! {format!("{:.2}%", 100.0 * mem as f64 / maxmem as f64)}
> -                        }
> -                        _ => html! {},
> -                    },
> -                )
> -                .sorter(
> -                    |a: &ClusterNodeIndexResponse, b: &ClusterNodeIndexResponse| a.mem.cmp(&b.mem),
> -                )
> +                .render(|entry: &PveNodeResource| {
> +                    // don't show values when the node isn't online or when it's non sensible
> +                    if entry.maxmem == 0 || entry.status != "online" {
> +                        return html! {};
> +                    }
> +                    html! {format!("{:.2}%", 100.0 * entry.mem as f64 / entry.maxmem as f64)}
> +                })
> +                .sorter(|a: &PveNodeResource, b: &PveNodeResource| a.mem.cmp(&b.mem))

Pre-existing, so material for a follow-up patch, but I think this sorter
should probably sort based on the shown percentage, not the absolute
value?

Otherwise sorting could pretty much appear random to the user, if the
amount of total memory differs per node?

>                  .into(),
>          );
>      }





  reply	other threads:[~2026-08-28 12:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-21 12:30 [PATCH datacenter-manager v3 0/9] refactor and partially fix #7371 Dominik Csapak
2026-08-21 12:30 ` [PATCH datacenter-manager v3 1/9] lib: api types: add new ResourceView type and move accessors there Dominik Csapak
2026-08-21 12:30 ` [PATCH datacenter-manager v3 2/9] lib: api types: resource: add 'node' helper to ResourceView Dominik Csapak
2026-08-21 12:30 ` [PATCH datacenter-manager v3 3/9] lib: api types: add guest specific getter " Dominik Csapak
2026-08-21 12:30 ` [PATCH datacenter-manager v3 4/9] ui: pve: factor out the pve-manager version extraction Dominik Csapak
2026-08-21 12:30 ` [PATCH datacenter-manager v3 5/9] ui: renderer: use ResourceView for rendering Dominik Csapak
2026-08-21 12:30 ` [PATCH datacenter-manager v3 6/9] ui: pve: tree: reuse `PveResource` for `PveTreeNode` Dominik Csapak
2026-08-21 12:30 ` [PATCH datacenter-manager v3 7/9] ui: pve: show ha maintenance mode for nodes Dominik Csapak
2026-08-28 12:56   ` Lukas Wagner
2026-08-21 12:30 ` [PATCH datacenter-manager v3 8/9] ui: pve: node selector: show maintenance badge with node name Dominik Csapak
2026-08-28 12:55   ` Lukas Wagner [this message]
2026-08-21 12:30 ` [PATCH datacenter-manager v3 9/9] ui: pve: node: show ha maintenance badge Dominik Csapak
2026-08-28 13:24 ` [PATCH datacenter-manager v3 0/9] refactor and partially fix #7371 Lukas Wagner

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=DL0LD4F6NSGN.3C5TNOQ9ZGOLP@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pdm-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