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 datacenter-manager 2/3] ui: make NodeStatusPanel available as a widget
Date: Thu,  6 Nov 2025 13:43:33 +0100	[thread overview]
Message-ID: <20251106124334.189955-6-s.sterz@proxmox.com> (raw)
In-Reply-To: <20251106124334.189955-1-s.sterz@proxmox.com>

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 ui/src/administration/mod.rs |  4 +++-
 ui/src/dashboard/types.rs    |  1 +
 ui/src/dashboard/view.rs     | 15 ++++++++++++++-
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/ui/src/administration/mod.rs b/ui/src/administration/mod.rs
index a9f7ac6..72a4ffa 100644
--- a/ui/src/administration/mod.rs
+++ b/ui/src/administration/mod.rs
@@ -16,7 +16,9 @@ use pwt_macros::builder;
 //mod services;
 //pub use services::Services;

-use proxmox_yew_comp::{AptPackageManager, AptRepositories, ExistingProduct, Syslog, Tasks};
+use proxmox_yew_comp::{
+    AptPackageManager, AptRepositories, ExistingProduct, NodeStatusPanel, Syslog, Tasks,
+};

 #[derive(Clone, PartialEq, Properties)]
 #[builder]
diff --git a/ui/src/dashboard/types.rs b/ui/src/dashboard/types.rs
index c79c38a..ce4bbb7 100644
--- a/ui/src/dashboard/types.rs
+++ b/ui/src/dashboard/types.rs
@@ -61,6 +61,7 @@ pub enum WidgetType {
     TaskSummary {
         grouping: TaskSummaryGrouping,
     },
+    NodeStatus,
 }

 #[derive(Serialize, Deserialize, PartialEq, Clone, Copy)]
diff --git a/ui/src/dashboard/view.rs b/ui/src/dashboard/view.rs
index c781d99..b5cd722 100644
--- a/ui/src/dashboard/view.rs
+++ b/ui/src/dashboard/view.rs
@@ -3,6 +3,7 @@ use std::rc::Rc;
 use anyhow::Error;
 use futures::join;
 use js_sys::Date;
+use proxmox_yew_comp::NodeStatusPanel;
 use serde_json::json;
 use yew::virtual_dom::{VComp, VNode};

@@ -123,6 +124,11 @@ fn render_widget(
             let (hours, since) = get_task_options(refresh_config.task_last_hours);
             create_task_summary_panel(statistics, remotes, hours, since)
         }
+        WidgetType::NodeStatus => {
+            return NodeStatusPanel::new()
+                .status_base_url("/nodes/localhost/status")
+                .into()
+        }
     };

     if let Some(title) = &item.title {
@@ -215,6 +221,9 @@ fn required_api_calls(layout: &ViewLayout) -> (bool, bool, bool) {
                         }
                         WidgetType::Leaderboard { .. } => top_entities = true,
                         WidgetType::TaskSummary { .. } => task_statistics = true,
+                        WidgetType::NodeStatus => {
+                            // widget handles this by itself
+                        }
                     }
                 }
             }
@@ -465,7 +474,11 @@ async fn load_template() -> Result<ViewTemplate, Error> {
                   \"widget-type\": \"pbs-datastores\"
                 },
                 {
-                  \"flex\": 5.0,
+                  \"flex\": 2.0,
+                  \"widget-type\": \"node-status\"
+                },
+                {
+                  \"flex\": 3.0,
                   \"widget-type\": \"subscription\"
                 }
               ],
--
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-06 12:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06 12:43 [pdm-devel] [PATCH datacenter-manager/proxmox/yew-comp 0/6] add node status panel to proxmox datacenter manager Shannon Sterz
2025-11-06 12:43 ` [pdm-devel] [PATCH proxmox 1/1] node-status: add node status crate Shannon Sterz
2025-11-06 12:43 ` [pdm-devel] [PATCH yew-comp 1/2] node info: extend NodeStatus enum to include NodeStatus from proxmox-rs Shannon Sterz
2025-11-06 12:43 ` [pdm-devel] [PATCH yew-comp 2/2] node status panel: add a panel that show the current status of a node Shannon Sterz
2025-11-06 12:43 ` [pdm-devel] [PATCH datacenter-manager 1/3] api-types/api: add endpoints for querying the node's status Shannon Sterz
2025-11-06 12:43 ` Shannon Sterz [this message]
2025-11-06 12:43 ` [pdm-devel] [PATCH datacenter-manager 3/3] nodes: remove unnecessary rustfmt::skip macro Shannon Sterz
2025-11-06 12:44 ` [pdm-devel] [PATCH datacenter-manager/proxmox/yew-comp 0/6] add node status panel to proxmox datacenter manager Shannon Sterz

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=20251106124334.189955-6-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