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 5CE261FF17A for ; Tue, 28 Oct 2025 10:50:28 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id B2F8A16F62; Tue, 28 Oct 2025 10:51:00 +0100 (CET) From: Stefan Hanreich To: pdm-devel@lists.proxmox.com Date: Tue, 28 Oct 2025 10:50:24 +0100 Message-ID: <20251028095026.84493-1-s.hanreich@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.188 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_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods 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. RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an 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] Subject: [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] sdn: add pending as status 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 SDN zones with pending changes were shown as unknown in the UI. Add the pending status to the status enum and display it in the frontend accordingly. Signed-off-by: Stefan Hanreich --- lib/pdm-api-types/src/resource.rs | 5 +++++ server/src/api/resources.rs | 3 +++ ui/src/dashboard/sdn_zone_panel.rs | 4 +++- ui/src/sdn/zone_tree.rs | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/pdm-api-types/src/resource.rs b/lib/pdm-api-types/src/resource.rs index e09678d..671ba05 100644 --- a/lib/pdm-api-types/src/resource.rs +++ b/lib/pdm-api-types/src/resource.rs @@ -372,6 +372,7 @@ pub struct SdnZoneResource { pub enum SdnStatus { Available, Error, + Pending, #[serde(other)] #[default] Unknown, @@ -383,6 +384,7 @@ impl std::str::FromStr for SdnStatus { fn from_str(value: &str) -> Result { Ok(match value { "ok" | "available" => Self::Available, + "pending" => Self::Pending, "error" => Self::Error, _ => Self::Unknown, }) @@ -397,6 +399,7 @@ impl SdnStatus { match self { Self::Available => "available", Self::Error => "error", + Self::Pending => "pending", Self::Unknown => "unknown", } } @@ -602,6 +605,8 @@ pub struct PbsDatastoreStatusCount { pub struct SdnZoneCount { /// Amount of available / ok zones pub available: u64, + /// Amount of sdn zones with pending changes + pub pending: u64, /// Amount of erroneous sdn zones pub error: u64, /// Amount of sdn zones with an unknown status diff --git a/server/src/api/resources.rs b/server/src/api/resources.rs index 3502c3b..0a50539 100644 --- a/server/src/api/resources.rs +++ b/server/src/api/resources.rs @@ -451,6 +451,9 @@ pub async fn get_status( SdnStatus::Error => { counts.sdn_zones.error += 1; } + SdnStatus::Pending => { + counts.sdn_zones.pending += 1; + } SdnStatus::Unknown => { counts.sdn_zones.unknown += 1; } diff --git a/ui/src/dashboard/sdn_zone_panel.rs b/ui/src/dashboard/sdn_zone_panel.rs index 0e26fa9..f08c4a8 100644 --- a/ui/src/dashboard/sdn_zone_panel.rs +++ b/ui/src/dashboard/sdn_zone_panel.rs @@ -46,6 +46,7 @@ impl StatusRow { Self::All(_) => ("th", None), Self::State(SdnStatus::Available, _) => ("check", Some(FontColor::Success)), Self::State(SdnStatus::Error, _) => ("times-circle", Some(FontColor::Error)), + Self::State(SdnStatus::Pending, _) => ("refresh", Some(FontColor::Warning)), Self::State(SdnStatus::Unknown, _) => ("question", None), }; @@ -87,8 +88,9 @@ impl yew::Component for SdnZonePanelComponent { let data = vec![ StatusRow::State(SdnStatus::Available, status.available), StatusRow::State(SdnStatus::Error, status.error), + StatusRow::State(SdnStatus::Pending, status.pending), StatusRow::State(SdnStatus::Unknown, status.unknown), - StatusRow::All(status.available + status.error + status.unknown), + StatusRow::All(status.available + status.pending + status.error + status.unknown), ]; let tiles: Vec<_> = data diff --git a/ui/src/sdn/zone_tree.rs b/ui/src/sdn/zone_tree.rs index 2f90764..c6a85e9 100644 --- a/ui/src/sdn/zone_tree.rs +++ b/ui/src/sdn/zone_tree.rs @@ -143,6 +143,9 @@ impl ZoneTreeComponent { SdnStatus::Available => { row.with_child(Fa::new("check").class(FontColor::Success)) } + SdnStatus::Pending => { + row.with_child(Fa::new("refresh").class(FontColor::Warning)) + } SdnStatus::Error => { row.with_child(Fa::new("times-circle").class(FontColor::Error)) } -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel