[pdm-devel] [PATCH datacenter-manager 5/7] ui: dashboard: distinguish failed remotes based on remote type

Dominik Csapak d.csapak at proxmox.com
Tue Oct 14 10:47:40 CEST 2025


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 <c.ebner at proxmox.com>
> ---
>   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))
>                       }





More information about the pdm-devel mailing list