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 F41FD1FF16F for ; Tue, 14 Oct 2025 10:47:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 25A0323F41; Tue, 14 Oct 2025 10:47:44 +0200 (CEST) Message-ID: <1a9276dd-4d76-474f-be6e-3be61e0b281d@proxmox.com> Date: Tue, 14 Oct 2025 10:47:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Proxmox Datacenter Manager development discussion , Christian Ebner References: <20251013085623.211136-1-c.ebner@proxmox.com> <20251013085623.211136-6-c.ebner@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20251013085623.211136-6-c.ebner@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1760431623608 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.028 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [mod.rs] Subject: Re: [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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" more of a high level comment regarding the node dashboard component, but it fits here as well as the previous patch: i believe we should rethink how we propagate the information to this panel, so that we don't have to extract the correct information inside e.g. either we restructure the api call/data in a way to separate the info by type in the first place, or we do that directly after the api call. either way I'd probably give this panel just a simple struct with the necessary information to display I think this would make it a bit easier to follow and less like that we forget to e.g. check the type for the content what do you say? On 10/13/25 10:56 AM, Christian Ebner wrote: > 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)) > } _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel