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 37B551FF13C for ; Thu, 19 Mar 2026 10:47:00 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id AAF2E179AE; Thu, 19 Mar 2026 10:47:07 +0100 (CET) From: Lukas Wagner To: pdm-devel@lists.proxmox.com Subject: [PATCH proxmox-yew-comp v2 15/25] node status panel: add `children` property Date: Thu, 19 Mar 2026 10:45:35 +0100 Message-ID: <20260319094617.169594-16-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260319094617.169594-1-l.wagner@proxmox.com> References: <20260319094617.169594-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773913541911 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.049 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 Message-ID-Hash: HIDYJCVTBP6KZ4FL4KLWQC37CQDGPXIO X-Message-ID-Hash: HIDYJCVTBP6KZ4FL4KLWQC37CQDGPXIO X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This property allows us to pass child VNodes that should be rendered on the same panel, allowing us to inject product specific UI elements. We also implement the ContainerBuilder trait for NodeStatusPanel, allowing us to use methods such as `with_child`, `with_optional_child` etc. Signed-off-by: Lukas Wagner Reviewed-by: Arthur Bied-Charreton Tested-by: Arthur Bied-Charreton --- src/node_status_panel.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/node_status_panel.rs b/src/node_status_panel.rs index 357c328..6dca90a 100644 --- a/src/node_status_panel.rs +++ b/src/node_status_panel.rs @@ -35,6 +35,10 @@ pub struct NodeStatusPanel { #[builder(IntoPropValue, into_prop_value)] #[prop_or_default] power_management_buttons: bool, + + /// Children that should be rendered on this panel + #[prop_or_default] + children: Vec, } impl NodeStatusPanel { @@ -49,6 +53,12 @@ impl Default for NodeStatusPanel { } } +impl ContainerBuilder for NodeStatusPanel { + fn as_children_mut(&mut self) -> &mut Vec { + &mut self.children + } +} + enum Msg { Error(Error), Loaded(Rc), @@ -203,6 +213,8 @@ impl LoadableComponent for ProxmoxNodeStatusPanel { } fn main_view(&self, ctx: &LoadableComponentContext) -> Html { + let props = ctx.props(); + let status = self .node_status .as_ref() @@ -222,6 +234,10 @@ impl LoadableComponent for ProxmoxNodeStatusPanel { .with_child(node_info(status)) .with_optional_child(self.error.as_ref().map(|e| error_message(&e.to_string()))); + for c in props.children.clone() { + panel = panel.with_child(c); + } + if ctx.props().power_management_buttons { panel.add_tool( ConfirmButton::new(tr!("Reboot")) -- 2.47.3