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 3ED301FF13A for ; Wed, 15 Apr 2026 15:20:41 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A348D14A38; Wed, 15 Apr 2026 15:20:36 +0200 (CEST) From: Lukas Wagner To: pdm-devel@lists.proxmox.com Subject: [PATCH proxmox-yew-comp v4 01/12] node status panel: add `children` property Date: Wed, 15 Apr 2026 15:20:02 +0200 Message-ID: <20260415132013.440581-2-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260415132013.440581-1-l.wagner@proxmox.com> References: <20260415132013.440581-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1776259153784 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.053 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: OISPB67KOYQQLWZWT2NW2ALZFIPBDICZ X-Message-ID-Hash: OISPB67KOYQQLWZWT2NW2ALZFIPBDICZ 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 Reviewed-by: Michael Köppl Tested-by: Arthur Bied-Charreton Tested-by: Michael Köppl --- 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