From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id E849B1FF183 for ; Wed, 3 Dec 2025 13:50:35 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D03CE8F24; Wed, 3 Dec 2025 13:51:01 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Wed, 3 Dec 2025 13:50:45 +0100 Message-ID: <20251203125056.2821841-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251203125056.2821841-1-d.csapak@proxmox.com> References: <20251203125056.2821841-1-d.csapak@proxmox.com> 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. [mod.rs, lib.rs, proxmox.com] Subject: [pdm-devel] [PATCH datacenter-manager v2 1/1] ui: pdm update panel: show correct subscription notice message 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" instead of the default one that does not fit for pdm hosts. For that, refactor the message + title generation into its own function, so we can reuse it for the generic alert dialog as well. Signed-off-by: Dominik Csapak --- change from v1: * rebase on master ui/src/administration/mod.rs | 5 ++++- ui/src/lib.rs | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ui/src/administration/mod.rs b/ui/src/administration/mod.rs index 9e45a425..760cc90b 100644 --- a/ui/src/administration/mod.rs +++ b/ui/src/administration/mod.rs @@ -20,6 +20,8 @@ mod node_status; use proxmox_yew_comp::{AptPackageManager, AptRepositories, ExistingProduct, Syslog, Tasks}; +use crate::pdm_subscription_title_and_message; + #[derive(Clone, PartialEq, Properties)] #[builder] pub struct ServerAdministration { @@ -88,7 +90,8 @@ impl Component for PdmServerAdministration { .with_child( AptPackageManager::new() .enable_upgrade(enable_upgrade) - .subscription_url("/nodes/localhost/subscription"), + .subscription_url("/nodes/localhost/subscription") + .subscription_message(pdm_subscription_title_and_message()), ) .into() }, diff --git a/ui/src/lib.rs b/ui/src/lib.rs index 5ca0461c..1aac7571 100644 --- a/ui/src/lib.rs +++ b/ui/src/lib.rs @@ -269,6 +269,14 @@ pub async fn check_pdm_subscription() -> bool { /// i.e., one that's not just relayed 1:1 to a specific remote node, as for that one should use the /// remote-specific alert. pub fn pdm_subscription_alert(on_close: impl IntoEventCallback<()>) -> AlertDialog { + let (title, msg) = pdm_subscription_title_and_message(); + AlertDialog::new(Container::from_tag("p").with_child(msg)) + .title(title) + .on_close(on_close) +} + +/// returns the PDM specific title and message for the subscription alert +pub fn pdm_subscription_title_and_message() -> (String, Html) { let dest = "pdm.proxmox.com" .to_string(); @@ -278,9 +286,7 @@ pub fn pdm_subscription_alert(on_close: impl IntoEventCallback<()>) -> AlertDial dest ); let msg = Html::from_html_unchecked(msg.into()); - AlertDialog::new(Container::from_tag("p").with_child(msg)) - .title(tr!("No valid subscriptions")) - .on_close(on_close) + (tr!("No valid subscriptions"), msg) } /// 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