[PATCH proxmox-yew-comp v2 15/25] node status panel: add `children` property

Lukas Wagner
2026-03-19T09:47:00Z

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 <l.wagner@proxmox.com>
Reviewed-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
Tested-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
---
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<VNode>,
}

impl NodeStatusPanel {
@@ -49,6 +53,12 @@ impl Default for NodeStatusPanel {
}
}

+impl ContainerBuilder for NodeStatusPanel {
+ fn as_children_mut(&mut self) -> &mut Vec<VNode> {
+ &mut self.children
+ }
+}
+
enum Msg {
Error(Error),
Loaded(Rc<NodeStatus>),
@@ -203,6 +213,8 @@ impl LoadableComponent for ProxmoxNodeStatusPanel {
}

fn main_view(&self, ctx: &LoadableComponentContext<Self>) -> 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