From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 2E2671FF16B for ; Fri, 26 Sep 2025 09:27:26 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4CFD49433; Fri, 26 Sep 2025 09:27:54 +0200 (CEST) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Fri, 26 Sep 2025 09:20:25 +0200 Message-ID: <20250926072749.560801-6-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250926072749.560801-1-d.csapak@proxmox.com> References: <20250926072749.560801-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.027 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pdm-devel] [PATCH datacenter-manager 05/11] ui: pve: tree: refactor rendering the tree column X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" so we can reuse it for PBS Signed-off-by: Dominik Csapak --- 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! {
}).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