From: Shannon Sterz <s.sterz@proxmox.com>
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 [thread overview]
Message-ID: <20260527125217.260760-5-s.sterz@proxmox.com> (raw)
In-Reply-To: <20260527125217.260760-1-s.sterz@proxmox.com>
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 <s.sterz@proxmox.com>
---
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<String> {
+ 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<serde_json::Value> {
@@ -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<T: Serialize>(ty: T) -> Option<String> {
}
}
-fn pdm_origin() -> Option<String> {
- 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
next prev parent reply other threads:[~2026-05-27 12:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 12:52 [PATCH datacenter-manager 0/6] improve handling of base url and certificate fingerprint for auto-installer gui Shannon Sterz
2026-05-27 12:52 ` [PATCH datacenter-manager 1/6] server: api: certificates: allow anybody to query the certificate info Shannon Sterz
2026-05-27 14:12 ` Filip Schauer
2026-05-27 14:16 ` Lukas Wagner
2026-05-27 14:17 ` Shannon Sterz
2026-05-27 12:52 ` [PATCH datacenter-manager 2/6] pdm-client: add function to query the PDM hosts " Shannon Sterz
2026-05-27 12:52 ` [PATCH datacenter-manager 3/6] ui: remotes: auto-installer: set pdm_origin() as placeholder not tip Shannon Sterz
2026-05-27 12:52 ` Shannon Sterz [this message]
2026-05-27 12:52 ` [PATCH datacenter-manager 5/6] ui: auto-installer: load fingerprint and use it as initial value Shannon Sterz
2026-05-27 12:52 ` [PATCH datacenter-manager 6/6] ui: auto-installer: use info from answer to format preparation command Shannon Sterz
2026-05-27 13:11 ` [PATCH datacenter-manager 0/6] improve handling of base url and certificate fingerprint for auto-installer gui Lukas Wagner
2026-05-27 14:02 ` applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260527125217.260760-5-s.sterz@proxmox.com \
--to=s.sterz@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox