public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH datacenter-manager] ui: change task summary sorting to failed tasks only
@ 2025-09-10 13:01 Dominik Csapak
  2025-09-10 15:12 ` [pdm-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2025-09-10 13:01 UTC (permalink / raw)
  To: pdm-devel

those are the most important to show, so sort only by failed tasks.

Signed-off-by: Dominik Csapak <d.csapak@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



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pdm-devel] applied: [PATCH datacenter-manager] ui: change task summary sorting to failed tasks only
  2025-09-10 13:01 [pdm-devel] [PATCH datacenter-manager] ui: change task summary sorting to failed tasks only Dominik Csapak
@ 2025-09-10 15:12 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-09-10 15:12 UTC (permalink / raw)
  To: pdm-devel, Dominik Csapak

On Wed, 10 Sep 2025 15:01:03 +0200, Dominik Csapak wrote:
> those are the most important to show, so sort only by failed tasks.
> 
> 

Applied, thanks!

[1/1] ui: change task summary sorting to failed tasks only
      commit: a27858fd52189125d213bbfecc66c95e94406116


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-10 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-10 13:01 [pdm-devel] [PATCH datacenter-manager] ui: change task summary sorting to failed tasks only Dominik Csapak
2025-09-10 15:12 ` [pdm-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal