From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager 4/4] ui: pve: lxc: pass the pve-manager version to panels
Date: Tue, 2 Dec 2025 11:00:05 +0100 [thread overview]
Message-ID: <20251202100012.1328096-7-d.csapak@proxmox.com> (raw)
In-Reply-To: <20251202100012.1328096-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 | 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<String>,
+
#[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! {<hr/>})
.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! {<hr/>})
.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! {<hr/>})
.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! {<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
next prev parent reply other threads:[~2025-12-02 10:00 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-02 9:59 [pdm-devel] [PATCH datacenter-manager/yew-comp 0/6] add basic version guarding for pve guests Dominik Csapak
2025-12-02 10:00 ` [pdm-devel] [PATCH yew-comp 1/2] qemu: options/hardware: prepare and use version feature gating Dominik Csapak
2025-12-02 10:32 ` Thomas Lamprecht
2025-12-02 10:53 ` Dominik Csapak
2025-12-02 10:00 ` [pdm-devel] [PATCH yew-comp 2/2] pve: lxc panels: prepare/add " Dominik Csapak
2025-12-02 10:00 ` [pdm-devel] [PATCH datacenter-manager 1/4] ui: subscription_info: add subscription counts Dominik Csapak
2025-12-02 10:00 ` [pdm-devel] [PATCH datacenter-manager 2/4] lib/server: pve: add api call to get the cached version info from remotes Dominik Csapak
2025-12-02 10:00 ` [pdm-devel] [PATCH datacenter-manager 3/4] ui: pve: qemu: load and pass the pve-manager version to panels Dominik Csapak
2025-12-02 10:00 ` Dominik Csapak [this message]
2025-12-02 11:18 ` [pdm-devel] superseded: [PATCH datacenter-manager/yew-comp 0/6] add basic version guarding for pve guests Dominik Csapak
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=20251202100012.1328096-7-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