From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id DABDC1FF15E for ; Mon, 13 Oct 2025 10:57:00 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8A10EF0B8; Mon, 13 Oct 2025 10:57:17 +0200 (CEST) From: Christian Ebner To: pdm-devel@lists.proxmox.com Date: Mon, 13 Oct 2025 10:56:21 +0200 Message-ID: <20251013085623.211136-6-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251013085623.211136-1-c.ebner@proxmox.com> References: <20251013085623.211136-1-c.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1760345766374 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.043 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 5/7] ui: dashboard: distinguish failed remotes based on remote type 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" The status information api call has been extended to include type and error information. Use this information to distinguish how to show the respective node status message. The number of failed remotes does not take into account which type it is, so use the failed nodes list to filter for the respective remote. Further, as a PVE node can have multiple nodes while the PBS remote is limited to one node, so discriminate that in the status as well. Signed-off-by: Christian Ebner --- ui/src/dashboard/mod.rs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/ui/src/dashboard/mod.rs b/ui/src/dashboard/mod.rs index ff63f6a..da62262 100644 --- a/ui/src/dashboard/mod.rs +++ b/ui/src/dashboard/mod.rs @@ -27,7 +27,7 @@ use pwt::{ use pdm_api_types::{ remotes::RemoteType, - resource::{NodeStatusCount, ResourcesStatus}, + resource::{FailedRemote, NodeStatusCount, ResourcesStatus}, TaskStatistics, }; use pdm_client::types::TopEntity; @@ -195,11 +195,26 @@ impl PdmDashboard { tr!("{0} nodes have an unknown status", unknown), ) } - // FIXME, get more detailed status about the failed remotes (name, type, error)? - NodeStatusCount { online, .. } if status.failed_remotes > 0 => ( - Status::Unknown.into(), - tr!("{0} of an unknown number of nodes online", online), - ), + NodeStatusCount { online, .. } if status.failed_remotes > 0 => { + let failed_remotes: Vec<&FailedRemote> = status + .failed_remotes_list + .iter() + .filter(|item| item.remote_type == remote_type) + .collect(); + if failed_remotes.is_empty() { + (Status::Success.into(), tr!("{0} nodes online", online)) + } else if remote_type == RemoteType::Pbs { + ( + Status::Error.into(), + tr!("{0} remotes failed", failed_remotes.len()), + ) + } else { + ( + Status::Unknown.into(), + tr!("{0} of an unknown number of nodes online", online), + ) + } + } NodeStatusCount { online, .. } => { (Status::Success.into(), tr!("{0} nodes online", online)) } -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel