[pdm-devel] [PATCH datacenter-manager v2 1/1] ui: pdm update panel: show correct subscription notice message
Dominik Csapak
d.csapak at proxmox.com
Wed Dec 3 13:50:45 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>
---
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 =
"<a target=\"_blank\" href=\"https://pdm.proxmox.com/docs/faq.html\">pdm.proxmox.com</a>"
.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
More information about the pdm-devel
mailing list