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 B471F1FF290 for ; Wed, 27 May 2026 14:52:58 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 857211C1A5; Wed, 27 May 2026 14:52:54 +0200 (CEST) From: Shannon Sterz To: pdm-devel@lists.proxmox.com Subject: [PATCH datacenter-manager 4/6] ui: remotes: auto-installer: use pdm_origin() to set initial pdm url Date: Wed, 27 May 2026 14:52:15 +0200 Message-ID: <20260527125217.260760-5-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260527125217.260760-1-s.sterz@proxmox.com> References: <20260527125217.260760-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1779886313334 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.111 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] Message-ID-Hash: F5L4CL6JGZ53RVM5MVSDKOVTWSBG4JCR X-Message-ID-Hash: F5L4CL6JGZ53RVM5MVSDKOVTWSBG4JCR X-MailFrom: s.sterz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: this should be a sensible default for most users. users that have a proxy between the pdm and the target hosts or similar can still override this in gui. adapts the node in the gui too to clarify this fact. Signed-off-by: Shannon Sterz --- ui/src/remotes/auto_installer/mod.rs | 8 ++++++++ .../auto_installer/prepared_answer_add_wizard.rs | 3 ++- .../remotes/auto_installer/prepared_answer_form.rs | 12 +++--------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ui/src/remotes/auto_installer/mod.rs b/ui/src/remotes/auto_installer/mod.rs index 08030e2..7657c2c 100644 --- a/ui/src/remotes/auto_installer/mod.rs +++ b/ui/src/remotes/auto_installer/mod.rs @@ -84,3 +84,11 @@ impl Component for AutoInstallerPanelComponent { .into() } } + +fn pdm_origin() -> Option { + gloo_utils::document() + .url() + .and_then(|s| web_sys::Url::new(&s)) + .map(|url| url.origin()) + .ok() +} diff --git a/ui/src/remotes/auto_installer/prepared_answer_add_wizard.rs b/ui/src/remotes/auto_installer/prepared_answer_add_wizard.rs index d099d5c..e909b6e 100644 --- a/ui/src/remotes/auto_installer/prepared_answer_add_wizard.rs +++ b/ui/src/remotes/auto_installer/prepared_answer_add_wizard.rs @@ -21,6 +21,7 @@ use proxmox_yew_comp::{ use pwt::{prelude::*, state::Store, widget::TabBarItem}; use pwt_macros::builder; +use super::pdm_origin; use super::prepared_answer_form::*; use crate::pdm_client; @@ -78,8 +79,8 @@ impl AddAnswerWizardProperties { disk_filter: BTreeMap::new(), disk_filter_match: None, // post hook - post_hook_base_url: None, post_hook_cert_fp: None, + post_hook_base_url: pdm_origin(), // templating template_counters, // subscription diff --git a/ui/src/remotes/auto_installer/prepared_answer_form.rs b/ui/src/remotes/auto_installer/prepared_answer_form.rs index 0e9dc2e..44cfcc5 100644 --- a/ui/src/remotes/auto_installer/prepared_answer_form.rs +++ b/ui/src/remotes/auto_installer/prepared_answer_form.rs @@ -38,6 +38,7 @@ use pwt::{ }, }; +use super::pdm_origin; use crate::remotes::auto_installer::token_selector::TokenSelector; pub fn prepare_form_data(mut value: serde_json::Value) -> Result { @@ -962,7 +963,8 @@ pub fn render_auth_form( .class("pwt-mt-2 pwt-color-primary") .with_child(Fa::new("info-circle").class("fa-fw")) .with_child(tr!( - "Optional. If provided, status reporting will be enabled." + "Optional. If provided, status reporting will be enabled. \ + Make sure that these values are correct from the perspective of the target host." )), ) .into() @@ -1182,14 +1184,6 @@ fn serde_variant_name(ty: T) -> Option { } } -fn pdm_origin() -> Option { - gloo_utils::document() - .url() - .and_then(|s| web_sys::Url::new(&s)) - .map(|url| url.origin()) - .ok() -} - const KEYBOARD_LAYOUTS: &[KeyboardLayout] = { use KeyboardLayout::*; &[ -- 2.47.3