[pdm-devel] [PATCH datacenter-manager 1/1] ui: pdm update panel: show correct subscription notice message

Dominik Csapak d.csapak at proxmox.com
Wed Dec 3 13:18:19 CET 2025


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 <d.csapak at proxmox.com>
---
 ui/src/administration/mod.rs |  5 ++++-
 ui/src/lib.rs                | 17 ++++++++++++-----
 2 files changed, 16 insertions(+), 6 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 b7f1c1e3..0ad0e7a6 100644
--- a/ui/src/lib.rs
+++ b/ui/src/lib.rs
@@ -260,17 +260,24 @@ pub async fn check_subscription() -> bool {
 
 /// Returns a an [`AlertDialog`] for the 'no valid subscription' popup.
 pub fn subscription_alert(on_close: impl IntoEventCallback<()>) -> AlertDialog {
-    let dest = "<a target=\"_blank\" href=\"https://pdm.proxmox.com/docs/faq.html\">pdm.proxmox.com</a>"
-        .to_string();
+    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 =
+        "<a target=\"_blank\" href=\"https://pdm.proxmox.com/docs/faq.html\">pdm.proxmox.com</a>"
+            .to_string();
 
     let msg = tr!(
         "Too many remote nodes without active basic or higher subscription. Please visit {0} for more details.",
         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





More information about the pdm-devel mailing list