public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager 05/11] ui: pve: tree: refactor rendering the tree column
Date: Fri, 26 Sep 2025 09:20:25 +0200	[thread overview]
Message-ID: <20250926072749.560801-6-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250926072749.560801-1-d.csapak@proxmox.com>

so we can reuse it for PBS

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 ui/src/pve/tree.rs | 15 ++-------------
 ui/src/renderer.rs | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/ui/src/pve/tree.rs b/ui/src/pve/tree.rs
index 299fd895..2d631048 100644
--- a/ui/src/pve/tree.rs
+++ b/ui/src/pve/tree.rs
@@ -26,7 +26,7 @@ use pdm_api_types::{
     RemoteUpid,
 };
 
-use crate::{get_deep_url, widget::MigrateWindow};
+use crate::{get_deep_url, renderer::render_tree_column, widget::MigrateWindow};
 
 use super::{
     utils::{self, render_guest_tags, render_lxc_name, render_qemu_name},
@@ -595,18 +595,7 @@ fn columns(
                     }
                 };
 
-                Row::new()
-                    .min_width(0)
-                    .class(AlignItems::Center)
-                    .gap(2)
-                    .with_child(icon)
-                    .with_child(
-                        Container::new()
-                            .with_child(text)
-                            .style("text-overflow", "ellipsis")
-                            .style("overflow", "hidden"),
-                    )
-                    .into()
+                render_tree_column(icon.into(), text).into()
             })
             .into(),
         DataTableColumn::new(tr!("Tags"))
diff --git a/ui/src/renderer.rs b/ui/src/renderer.rs
index 2383c44d..5f7c6589 100644
--- a/ui/src/renderer.rs
+++ b/ui/src/renderer.rs
@@ -1,9 +1,10 @@
 use pdm_api_types::resource::PveSdnResource;
 use proxmox_yew_comp::MeterLabel;
 use pwt::{
+    css::AlignItems,
     prelude::*,
     props::ContainerBuilder,
-    widget::{Container, Fa},
+    widget::{Container, Fa, Row},
 };
 
 use proxmox_human_byte::HumanByte;
@@ -87,3 +88,17 @@ pub(crate) fn memory_status_row(used: u64, total: u64) -> MeterLabel {
 pub(crate) fn separator() -> Container {
     Container::new().with_child(html! {<hr />}).padding_y(2)
 }
+
+pub(crate) fn render_tree_column(icon: Html, text: String) -> Row {
+    Row::new()
+        .min_width(0)
+        .class(AlignItems::Center)
+        .gap(2)
+        .with_child(icon)
+        .with_child(
+            Container::new()
+                .with_child(text)
+                .style("text-overflow", "ellipsis")
+                .style("overflow", "hidden"),
+        )
+}
-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  parent reply	other threads:[~2025-09-26  7:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-26  7:20 [pdm-devel] [PATCH datacenter-manager 00/11] improve PBS view Dominik Csapak
2025-09-26  7:20 ` [pdm-devel] [PATCH datacenter-manager 01/11] server: api: return list of pve/pbs remotes Dominik Csapak
2025-09-26  7:20 ` [pdm-devel] [PATCH datacenter-manager 02/11] server: api: pbs: add status api call Dominik Csapak
2025-09-26  7:20 ` [pdm-devel] [PATCH datacenter-manager 03/11] server: pbs-client: use `json` formatter for the snapshot list streaming api Dominik Csapak
2025-09-26  7:20 ` [pdm-devel] [PATCH datacenter-manager 04/11] pdm-client: add pbs node status helper Dominik Csapak
2025-09-26  7:20 ` Dominik Csapak [this message]
2025-09-26  7:20 ` [pdm-devel] [PATCH datacenter-manager 06/11] ui: add helper to compare two strings with `localeCompare` Dominik Csapak
2025-09-26  7:20 ` [pdm-devel] [PATCH datacenter-manager 07/11] ui: pbs: add datastore tree Dominik Csapak
2025-09-26  7:20 ` [pdm-devel] [PATCH datacenter-manager 08/11] ui: pbs: convert snapshot list to a snapshot tree Dominik Csapak
2025-09-26  7:20 ` [pdm-devel] [PATCH datacenter-manager 09/11] ui: pbs: add datastore panel component Dominik Csapak
2025-09-26  7:20 ` [pdm-devel] [PATCH datacenter-manager 10/11] ui: pbs: add remote overview panel Dominik Csapak
2025-09-26  7:20 ` [pdm-devel] [PATCH datacenter-manager 11/11] ui: pbs: use new pbs panels/overview Dominik Csapak
2025-09-26 13:45 ` [pdm-devel] applied: [PATCH datacenter-manager 00/11] improve PBS view 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=20250926072749.560801-6-d.csapak@proxmox.com \
    --to=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 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