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 56C3F1FF187 for ; Tue, 2 Dec 2025 11:00:01 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A6EE7A897; Tue, 2 Dec 2025 11:00:23 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Tue, 2 Dec 2025 11:00:05 +0100 Message-ID: <20251202100012.1328096-7-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251202100012.1328096-1-d.csapak@proxmox.com> References: <20251202100012.1328096-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 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 4/4] ui: pve: lxc: pass the pve-manager version to panels 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" this will be used by the panels to feature gate by version. Signed-off-by: Dominik Csapak --- ui/src/pve/lxc/mod.rs | 15 +++++++++++++-- ui/src/pve/mod.rs | 8 +++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ui/src/pve/lxc/mod.rs b/ui/src/pve/lxc/mod.rs index 7429e07c..8a177a42 100644 --- a/ui/src/pve/lxc/mod.rs +++ b/ui/src/pve/lxc/mod.rs @@ -8,10 +8,10 @@ use std::rc::Rc; use yew::virtual_dom::{VComp, VNode}; -use pwt::prelude::*; - use pwt::css::FlexFit; +use pwt::prelude::*; use pwt::widget::{Button, Column, Container, Fa, Row, TabBarItem, TabPanel, Tooltip}; +use pwt_macros::builder; use pdm_api_types::resource::PveLxcResource; @@ -19,11 +19,17 @@ use crate::pve::utils::render_lxc_name; use crate::renderer::render_title_row; #[derive(Clone, Debug, Properties, PartialEq)] +#[builder] pub struct LxcPanel { remote: String, node: String, info: PveLxcResource, + #[prop_or_default] + #[builder] + /// The nodes pve-manager version, used to feature gate some entries. + pve_manager_version: Option, + #[prop_or(60_000)] /// The interval for refreshing the rrd data pub rrd_interval: u32, @@ -108,6 +114,7 @@ impl yew::Component for LxcPanelComp { let remote = props.remote.clone(); let node = props.node.clone(); let vmid = props.info.vmid; + let pve_manager_version = props.pve_manager_version.clone(); move |_| { Container::new() .class(FlexFit) @@ -119,6 +126,7 @@ impl yew::Component for LxcPanelComp { .with_child(html! {
}) .with_child( LxcResourcesPanel::new(node.clone(), vmid) + .pve_manager_version(pve_manager_version.clone()) .readonly(true) .remote(remote.clone()), ) @@ -128,6 +136,7 @@ impl yew::Component for LxcPanelComp { .with_child(html! {
}) .with_child( LxcNetworkPanel::new(node.clone(), vmid) + .pve_manager_version(pve_manager_version.clone()) .readonly(true) .remote(remote.clone()), ) @@ -135,6 +144,7 @@ impl yew::Component for LxcPanelComp { .with_child(html! {
}) .with_child( LxcDnsPanel::new(node.clone(), vmid) + .pve_manager_version(pve_manager_version.clone()) .readonly(true) .remote(remote.clone()), ) @@ -144,6 +154,7 @@ impl yew::Component for LxcPanelComp { .with_child(html! {
}) .with_child( LxcOptionsPanel::new(node.clone(), vmid) + .pve_manager_version(pve_manager_version.clone()) .readonly(true) .remote(remote.clone()), ), diff --git a/ui/src/pve/mod.rs b/ui/src/pve/mod.rs index 6ec323e5..d0d038dd 100644 --- a/ui/src/pve/mod.rs +++ b/ui/src/pve/mod.rs @@ -205,7 +205,13 @@ impl LoadableComponent for PveRemoteComp { .into() } PveTreeNode::Lxc(lxc) => { - lxc::LxcPanel::new(remote.clone(), lxc.node.clone(), lxc.clone()).into() + let pve_manager = match &self.updates.data { + Some(updates) => extract_package_version(updates, &lxc.node, "pve-manager"), + None => None, + }; + lxc::LxcPanel::new(remote.clone(), lxc.node.clone(), lxc.clone()) + .pve_manager_version(pve_manager) + .into() } PveTreeNode::Storage(storage) => { storage::StoragePanel::new(remote.clone(), storage.node.clone(), storage.clone()) -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel