[pdm-devel] [PATCH datacenter-manager 5/7] ui: dashboard: distinguish failed remotes based on remote type
Christian Ebner
c.ebner at proxmox.com
Mon Oct 13 10:56:21 CEST 2025
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))
}
--
2.47.3
More information about the pdm-devel
mailing list