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 v2 3/3] ui: pve: lxc: pass the pve-manager version to panels
Date: Tue,  2 Dec 2025 12:13:34 +0100	[thread overview]
Message-ID: <20251202111533.2068448-6-d.csapak@proxmox.com> (raw)
In-Reply-To: <20251202111533.2068448-1-d.csapak@proxmox.com>

this will be used by the panels to feature gate by version.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 ui/src/pve/lxc/mod.rs | 16 ++++++++++++++--
 ui/src/pve/mod.rs     |  8 +++++++-
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/ui/src/pve/lxc/mod.rs b/ui/src/pve/lxc/mod.rs
index 7429e07c..949fefb9 100644
--- a/ui/src/pve/lxc/mod.rs
+++ b/ui/src/pve/lxc/mod.rs
@@ -8,10 +8,11 @@ use std::rc::Rc;
 
 use yew::virtual_dom::{VComp, VNode};
 
-use pwt::prelude::*;
-
+use proxmox_deb_version::Version;
 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 +20,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<Version>,
+
     #[prop_or(60_000)]
     /// The interval for refreshing the rrd data
     pub rrd_interval: u32,
@@ -108,6 +115,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 +127,7 @@ impl yew::Component for LxcPanelComp {
                                     .with_child(html! {<hr/>})
                                     .with_child(
                                         LxcResourcesPanel::new(node.clone(), vmid)
+                                            .pve_manager_version(pve_manager_version.clone())
                                             .readonly(true)
                                             .remote(remote.clone()),
                                     )
@@ -128,6 +137,7 @@ impl yew::Component for LxcPanelComp {
                                     .with_child(html! {<hr/>})
                                     .with_child(
                                         LxcNetworkPanel::new(node.clone(), vmid)
+                                            .pve_manager_version(pve_manager_version.clone())
                                             .readonly(true)
                                             .remote(remote.clone()),
                                     )
@@ -135,6 +145,7 @@ impl yew::Component for LxcPanelComp {
                                     .with_child(html! {<hr/>})
                                     .with_child(
                                         LxcDnsPanel::new(node.clone(), vmid)
+                                            .pve_manager_version(pve_manager_version.clone())
                                             .readonly(true)
                                             .remote(remote.clone()),
                                     )
@@ -144,6 +155,7 @@ impl yew::Component for LxcPanelComp {
                                     .with_child(html! {<hr/>})
                                     .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


  parent reply	other threads:[~2025-12-02 11:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 11:13 [pdm-devel] [PATCH datacenter-manager/yew-comp v2 0/5] add basic version guarding for pve guests config Dominik Csapak
2025-12-02 11:13 ` [pdm-devel] [PATCH yew-comp v2 1/2] pve: qemu: options/hardware: prepare and use version feature gating Dominik Csapak
2025-12-02 12:16   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-02 11:13 ` [pdm-devel] [PATCH yew-comp v2 2/2] pve: lxc panels: prepare/add " Dominik Csapak
2025-12-02 12:17   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-02 11:13 ` [pdm-devel] [PATCH datacenter-manager v2 1/3] lib/server: pve: add api call to get the cached version info from remotes Dominik Csapak
2025-12-02 11:46   ` Thomas Lamprecht
2025-12-02 12:17   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-02 11:13 ` [pdm-devel] [PATCH datacenter-manager v2 2/3] ui: pve: qemu: load and pass the pve-manager version to panels Dominik Csapak
2025-12-02 12:17   ` [pdm-devel] applied: " Thomas Lamprecht
2025-12-02 11:13 ` Dominik Csapak [this message]
2025-12-02 12:17   ` [pdm-devel] applied: [PATCH datacenter-manager v2 3/3] ui: pve: lxc: " 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=20251202111533.2068448-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