all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager] ui: change task summary sorting to failed tasks only
Date: Wed, 10 Sep 2025 15:01:03 +0200	[thread overview]
Message-ID: <20250910130404.227205-1-d.csapak@proxmox.com> (raw)

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


             reply	other threads:[~2025-09-10 13:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10 13:01 Dominik Csapak [this message]
2025-09-10 15:12 ` [pdm-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250910130404.227205-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal