[pdm-devel] [PATCH datacenter-manager] ui: change task summary sorting to failed tasks only
Dominik Csapak
d.csapak at proxmox.com
Wed Sep 10 15:01:03 CEST 2025
those are the most important to show, so sort only by failed tasks.
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
i did not come up with a better title for the card, maybe someone else
has a better idea. Ideas i discarded:
* Failed Task Leaderboard (rejected because it's not only failed tasks)
* Top X Remotes by Failed Tasks (rejected because it's not 100% clear it's
about tasks)
* Task Summary of Remotes Sorted By Failed Tasks (rejected because
it's too long, so i cut the 'of Remotes' part)
ui/src/dashboard/mod.rs | 6 +++++-
ui/src/dashboard/tasks.rs | 6 +-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/ui/src/dashboard/mod.rs b/ui/src/dashboard/mod.rs
index 9c52d1f..6135568 100644
--- a/ui/src/dashboard/mod.rs
+++ b/ui/src/dashboard/mod.rs
@@ -272,7 +272,11 @@ impl PdmDashboard {
) -> Panel {
let (hours, since) = Self::get_task_options(&self.config);
let title = match remotes {
- Some(count) => tr!("Task Summary for Top {0} Remotes (Last {1}h)", count, hours),
+ Some(count) => tr!(
+ "Task Summary Sorted by Failed Tasks (Last {1}h)",
+ count,
+ hours
+ ),
None => tr!("Task Summary by Category (Last {0}h)", hours),
};
Panel::new()
diff --git a/ui/src/dashboard/tasks.rs b/ui/src/dashboard/tasks.rs
index 29d4e64..d32cf37 100644
--- a/ui/src/dashboard/tasks.rs
+++ b/ui/src/dashboard/tasks.rs
@@ -129,11 +129,7 @@ fn extract_task_summary_remote(data: &TaskStatistics, limit: u32) -> Vec<TaskSum
}
let mut list: Vec<TaskSummaryItem> = map.into_values().collect();
- list.sort_by(|a, b| {
- let a_count = a.error_count + a.warning_count + a.ok_count;
- let b_count = b.error_count + b.warning_count + b.ok_count;
- b_count.cmp(&a_count)
- });
+ list.sort_by(|a, b| b.error_count.cmp(&a.error_count));
list.into_iter().take(limit as usize).collect()
}
--
2.47.3
More information about the pdm-devel
mailing list