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 310B21FF183 for ; Wed, 3 Dec 2025 10:59:23 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4C28E54B5; Wed, 3 Dec 2025 10:59:49 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Wed, 3 Dec 2025 10:59:37 +0100 Message-ID: <20251203095945.1459122-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 0.030 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 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. [lib.rs] Subject: [pdm-devel] [PATCH datacenter-manager 1/3] ui: mark subscription check as active if no remotes are configured 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" by checking the 'total_nodes' value of the subscription for 0 Signed-off-by: Dominik Csapak --- ui/src/lib.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/src/lib.rs b/ui/src/lib.rs index 20dcec8b..76d60a37 100644 --- a/ui/src/lib.rs +++ b/ui/src/lib.rs @@ -2,6 +2,7 @@ use js_sys::{Array, JsString, Object}; use pdm_api_types::remote_updates::RemoteUpdateSummary; use pdm_api_types::remotes::RemoteType; use pdm_api_types::resource::{PveLxcResource, PveQemuResource}; +use pdm_api_types::subscription::PdmSubscriptionInfo; use pdm_client::types::Resource; use proxmox_deb_version::Version; use serde::{Deserialize, Serialize}; @@ -241,7 +242,15 @@ pub(crate) fn locale_compare(first: String, second: &str, numeric: bool) -> std: /// Returns true if the global subscription checks succeeded pub async fn check_subscription() -> bool { let data: Result = http_get("/nodes/localhost/subscription", None).await; - proxmox_yew_comp::subscription_is_active(Some(&data)) + let mut is_active = proxmox_yew_comp::subscription_is_active(Some(&data)); + if !is_active { + if let Ok(Ok(info)) = data.map(serde_json::from_value::) { + if info.statistics.total_nodes == 0 { + is_active = true; + } + } + } + is_active } /// Extract the version of a specific package from `RemoteUpdateSummary` for a specific node -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel