From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 6D1621FF183 for ; Wed, 10 Sep 2025 15:04:04 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6735621404; Wed, 10 Sep 2025 15:04:08 +0200 (CEST) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Wed, 10 Sep 2025 15:01:03 +0200 Message-ID: <20250910130404.227205-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -2.474 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [tasks.rs, mod.rs] URIBL_DBL_SPAM 5 Contains a spam URL listed in the Spamhaus DBL blocklist [tasks.rs] Subject: [pdm-devel] [PATCH datacenter-manager] ui: change task summary sorting to failed tasks only X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" those are the most important to show, so sort only by failed tasks. Signed-off-by: Dominik Csapak --- 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 = 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