public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Shannon Sterz <s.sterz@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH yew-comp v5 2/2] node status panel: make power management and fingerprint buttons opt-in
Date: Thu, 13 Nov 2025 14:32:07 +0100	[thread overview]
Message-ID: <20251113133208.426106-3-s.sterz@proxmox.com> (raw)
In-Reply-To: <20251113133208.426106-1-s.sterz@proxmox.com>

the panel appeared to dense with all these tools being present in
every situation. so make them opt-in.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 src/node_status_panel.rs | 35 +++++++++++++++++++++++++----------
 1 file changed, 25 insertions(+), 10 deletions(-)

diff --git a/src/node_status_panel.rs b/src/node_status_panel.rs
index 3d37d80..3f8946d 100644
--- a/src/node_status_panel.rs
+++ b/src/node_status_panel.rs
@@ -27,6 +27,14 @@ pub struct NodeStatusPanel {
     #[builder(IntoPropValue, into_prop_value)]
     #[prop_or_default]
     status_base_url: Option<AttrValue>,
+
+    #[builder(IntoPropValue, into_prop_value)]
+    #[prop_or_default]
+    fingerprint_button: bool,
+
+    #[builder(IntoPropValue, into_prop_value)]
+    #[prop_or_default]
+    power_management_buttons: bool,
 }
 
 impl NodeStatusPanel {
@@ -195,7 +203,7 @@ impl LoadableComponent for ProxmoxNodeStatusPanel {
             .as_ref()
             .map(|r| crate::NodeStatus::Common(r));
 
-        Panel::new()
+        let mut panel = Panel::new()
             .border(false)
             .class(FlexFit)
             .title(
@@ -206,7 +214,11 @@ impl LoadableComponent for ProxmoxNodeStatusPanel {
                     .with_child(tr!("Node Status"))
                     .into_html(),
             )
-            .with_tool(
+            .with_child(node_info(status))
+            .with_optional_child(self.error.as_ref().map(|e| error_message(&e.to_string())));
+
+        if ctx.props().power_management_buttons {
+            panel.add_tool(
                 ConfirmButton::new(tr!("Reboot"))
                     .confirm_message(tr!("Are you sure you want to reboot the node?"))
                     .on_activate(
@@ -214,8 +226,8 @@ impl LoadableComponent for ProxmoxNodeStatusPanel {
                             .callback(|_| Msg::RebootOrShutdown(NodePowerCommand::Reboot)),
                     )
                     .icon_class("fa fa-undo"),
-            )
-            .with_tool(
+            );
+            panel.add_tool(
                 ConfirmButton::new(tr!("Shutdown"))
                     .confirm_message(tr!("Are you sure you want to shut down the node?"))
                     .on_activate(
@@ -223,8 +235,11 @@ impl LoadableComponent for ProxmoxNodeStatusPanel {
                             .callback(|_| Msg::RebootOrShutdown(NodePowerCommand::Shutdown)),
                     )
                     .icon_class("fa fa-power-off"),
-            )
-            .with_tool(
+            );
+        }
+
+        if ctx.props().fingerprint_button {
+            panel.add_tool(
                 Button::new(tr!("Show Fingerprint"))
                     .icon_class("fa fa-hashtag")
                     .class(ColorScheme::Primary)
@@ -232,10 +247,10 @@ impl LoadableComponent for ProxmoxNodeStatusPanel {
                         ctx.link()
                             .change_view_callback(|_| ViewState::FingerprintDialog),
                     ),
-            )
-            .with_child(node_info(status))
-            .with_optional_child(self.error.as_ref().map(|e| error_message(&e.to_string())))
-            .into()
+            );
+        }
+
+        panel.into()
     }
 }
 
-- 
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-11-13 13:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 13:32 [pdm-devel] [PATCH datacenter-manager/yew-comp v5 0/3] add node status panel to proxmox datacenter manager Shannon Sterz
2025-11-13 13:32 ` [pdm-devel] [PATCH yew-comp v5 1/2] node_info: only use build date from kernel version Shannon Sterz
2025-11-13 13:32 ` Shannon Sterz [this message]
2025-11-13 13:32 ` [pdm-devel] [PATCH datacenter-manager v5 1/1] ui: add a Node Status tab to the administration panel Shannon Sterz
2025-11-13 21:43 ` [pdm-devel] applied-series: [PATCH datacenter-manager/yew-comp v5 0/3] add node status panel to proxmox datacenter manager 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=20251113133208.426106-3-s.sterz@proxmox.com \
    --to=s.sterz@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