[pdm-devel] [PATCH datacenter-manager 2/3] ui: views: remote panel: improve and defuse error for unreachable remotes
Dominik Csapak
d.csapak at proxmox.com
Wed Dec 3 09:23:27 CET 2025
split cases into:
* all failed
* more than 50% failed -> error
* less than 50% failed -> warning
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
ui/src/dashboard/remote_panel.rs | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/ui/src/dashboard/remote_panel.rs b/ui/src/dashboard/remote_panel.rs
index 16125a9b..375e32ea 100644
--- a/ui/src/dashboard/remote_panel.rs
+++ b/ui/src/dashboard/remote_panel.rs
@@ -82,9 +82,27 @@ impl Component for PdmRemotePanel {
tr!("Could reach all remotes."),
false,
),
- (failed, _) => (
+ (_, 0) => (
Fa::from(Status::Error),
- tr!("Failed to reach one remote." | "Failed to reach {n} remotes." % failed),
+ tr!("Failed to reach all remotes"),
+ true,
+ ),
+ (failed, remotes) if failed > remotes => (
+ Fa::from(Status::Error),
+ tr!(
+ "Failed to reach {0} out of {1} remotes",
+ failed,
+ failed + remotes
+ ),
+ true,
+ ),
+ (failed, remotes) => (
+ Fa::from(Status::Warning),
+ tr!(
+ "Failed to reach one of {0} remotes."
+ | "Failed to reach {n} of {0} remotes." % failed,
+ failed + remotes
+ ),
true,
),
};
--
2.47.3
More information about the pdm-devel
mailing list