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 DEA551FF165 for ; Thu, 6 Nov 2025 13:43:08 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4E67615A60; Thu, 6 Nov 2025 13:43:50 +0100 (CET) From: Shannon Sterz To: pdm-devel@lists.proxmox.com Date: Thu, 6 Nov 2025 13:43:33 +0100 Message-ID: <20251106124334.189955-6-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251106124334.189955-1-s.sterz@proxmox.com> References: <20251106124334.189955-1-s.sterz@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1762432997629 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.060 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 Subject: [pdm-devel] [PATCH datacenter-manager 2/3] ui: make NodeStatusPanel available as a widget X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" Signed-off-by: Shannon Sterz --- 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 { \"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