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 665CC1FF15E for ; Mon, 27 Oct 2025 11:02:29 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B62C6348; Mon, 27 Oct 2025 11:03:00 +0100 (CET) From: Christian Ebner To: pdm-devel@lists.proxmox.com Date: Mon, 27 Oct 2025 11:02:11 +0100 Message-ID: <20251027100211.61467-1-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761559336608 X-SPAM-LEVEL: Spam detection results: 1 AWL -2.832 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 KAM_SOMETLD_ARE_BAD_TLD 5 .bar, .beauty, .buzz, .cam, .casa, .cfd, .club, .date, .guru, .link, .live, .monster, .online, .press, .pw, .quest, .rest, .sbs, .shop, .stream, .top, .trade, .wiki, .work, .xyz TLD abuse PDS_OTHER_BAD_TLD 0.75 Untrustworthy TLDs 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. [resources.rs, resource.rs, status.online] Subject: [pdm-devel] [PATCH datacenter-manager] api-types/ui/resources: Use more idiomatic 'under maintenance' 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" Currently 'in maintenance' is used when listing and filtering for datastore having a maintenance mode set. This would be better stated as 'in maintenance mode', which is however a bit long and unhandy for the filtering. Therefore, switch to a better fitting 'under maintenance' Suggested-by: Lukas Wagner Signed-off-by: Christian Ebner --- lib/pdm-api-types/src/resource.rs | 4 ++-- server/src/api/resources.rs | 2 +- ui/src/dashboard/pbs_datastores_panel.rs | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/pdm-api-types/src/resource.rs b/lib/pdm-api-types/src/resource.rs index e3c84cf..e09678d 100644 --- a/lib/pdm-api-types/src/resource.rs +++ b/lib/pdm-api-types/src/resource.rs @@ -102,7 +102,7 @@ impl Resource { if r.maintenance.is_none() { "online" } else { - "in-maintenance" + "under-maintenance" } } } @@ -581,7 +581,7 @@ pub struct PbsDatastoreStatusCount { /// Amount of online datastores pub online: u64, /// Amount of datastores which are in a maintenance mode - pub in_maintenance: Option, + pub under_maintenance: Option, /// Amount of datastores which have high datastore usage #[serde(skip_serializing_if = "Option::is_none")] pub high_usage: Option, diff --git a/server/src/api/resources.rs b/server/src/api/resources.rs index 57563b3..3502c3b 100644 --- a/server/src/api/resources.rs +++ b/server/src/api/resources.rs @@ -462,7 +462,7 @@ pub async fn get_status( if r.maintenance.is_none() { counts.pbs_datastores.online += 1; } else { - *counts.pbs_datastores.in_maintenance.get_or_insert_default() += 1; + *counts.pbs_datastores.under_maintenance.get_or_insert_default() += 1; } if r.usage > PBS_DATASTORE_HIGH_USAGE_THRESHOLD { *counts.pbs_datastores.high_usage.get_or_insert_default() += 1; diff --git a/ui/src/dashboard/pbs_datastores_panel.rs b/ui/src/dashboard/pbs_datastores_panel.rs index e028476..3e148e6 100644 --- a/ui/src/dashboard/pbs_datastores_panel.rs +++ b/ui/src/dashboard/pbs_datastores_panel.rs @@ -39,7 +39,7 @@ impl From for VNode { #[derive(PartialEq, Clone)] pub enum StatusRow { Online(u64), - InMaintenance(u64), + UnderMaintenance(u64), Removable(u64), S3Backend(u64), HighUsage(u64), @@ -74,12 +74,12 @@ impl yew::Component for PbsDatastoresPanelComponent { let data = vec![ StatusRow::Online(status.online), - StatusRow::InMaintenance(status.in_maintenance.unwrap_or_default()), + StatusRow::UnderMaintenance(status.under_maintenance.unwrap_or_default()), StatusRow::Removable(status.removable.unwrap_or_default()), StatusRow::S3Backend(status.s3_backend.unwrap_or_default()), StatusRow::HighUsage(status.high_usage.unwrap_or_default()), StatusRow::Unknown(status.unknown.unwrap_or_default()), - StatusRow::All(status.online + status.in_maintenance.unwrap_or_default()), + StatusRow::All(status.online + status.under_maintenance.unwrap_or_default()), ]; let tiles: Vec<_> = data @@ -115,11 +115,11 @@ fn create_list_tile( "High usage", Some(("high-usage", "property")), ), - StatusRow::InMaintenance(count) => ( + StatusRow::UnderMaintenance(count) => ( Fa::new("wrench"), count, - "In Maintenance", - Some(("in-maintenance", "status")), + "Under Maintenance", + Some(("under-maintenance", "status")), ), StatusRow::Removable(count) => ( Fa::new("plug"), -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel