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 9025E1FF13A 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 1D6201C254; Wed, 27 May 2026 14:52:55 +0200 (CEST) From: Shannon Sterz To: pdm-devel@lists.proxmox.com Subject: [PATCH datacenter-manager 6/6] ui: auto-installer: use info from answer to format preparation command Date: Wed, 27 May 2026 14:52:17 +0200 Message-ID: <20260527125217.260760-7-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: 1779886313510 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.110 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 WEIRD_PORT 0.001 Uses non-standard port number for HTTP Message-ID-Hash: DZTTNY4GYPT6PGEW2JZR6KYHTQPBDIWX X-Message-ID-Hash: DZTTNY4GYPT6PGEW2JZR6KYHTQPBDIWX 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: previously we always used the current origin and the nodes current certificate to format the command for iso preparation. since users can override them and we have that info when creating a new answer, use that instead there. the preparation command when adding or regenerating tokens is unaffected. Signed-off-by: Shannon Sterz --- .../auto_installer/prepared_answer_form.rs | 5 ++++- .../auto_installer/prepared_answers_panel.rs | 15 ++++++++++++++- ui/src/remotes/auto_installer/token_panel.rs | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ui/src/remotes/auto_installer/prepared_answer_form.rs b/ui/src/remotes/auto_installer/prepared_answer_form.rs index 46867a2..d1b6a62 100644 --- a/ui/src/remotes/auto_installer/prepared_answer_form.rs +++ b/ui/src/remotes/auto_installer/prepared_answer_form.rs @@ -972,6 +972,7 @@ pub fn render_auth_form( pub fn render_show_secret_dialog( config_id: Option<&str>, + answer_base_url: Option<&str>, token: &AnswerToken, secret: &str, fingerprint: &Option, @@ -1008,7 +1009,9 @@ pub fn render_show_secret_dialog( let answer_url = format!( "{}/api2/json/auto-install/answer", - pdm_origin().unwrap_or_else(|| "https://pdm.example.com:8443".to_owned()) + answer_base_url + .or(pdm_origin().as_deref()) + .unwrap_or_else(|| "https://pdm.example.com:8443") ); let mut commandline = format!( diff --git a/ui/src/remotes/auto_installer/prepared_answers_panel.rs b/ui/src/remotes/auto_installer/prepared_answers_panel.rs index a55c029..1850bb6 100644 --- a/ui/src/remotes/auto_installer/prepared_answers_panel.rs +++ b/ui/src/remotes/auto_installer/prepared_answers_panel.rs @@ -52,6 +52,8 @@ enum ViewState { Edit, DisplaySecret { config_id: String, + url: Option, + fingerprint: Option, token: AnswerToken, secret: String, }, @@ -63,6 +65,8 @@ enum Message { RemoveEntry, DisplaySecret { config_id: String, + url: Option, + fingerprint: Option, token: AnswerToken, secret: String, }, @@ -152,11 +156,15 @@ impl LoadableComponent for PreparedAnswersPanelComponent { } Message::DisplaySecret { config_id, + url, + fingerprint, token, secret, } => { link.change_view(Some(Self::ViewState::DisplaySecret { config_id, + url, + fingerprint, token, secret, })); @@ -224,6 +232,8 @@ impl LoadableComponent for PreparedAnswersPanelComponent { if let Some(token) = new_token { Self::Message::DisplaySecret { config_id: config.id, + url: config.post_hook_base_url, + fingerprint: config.post_hook_cert_fp, token: token.token, secret: token.secret, } @@ -275,13 +285,16 @@ impl LoadableComponent for PreparedAnswersPanelComponent { } Self::ViewState::DisplaySecret { config_id, + url, + fingerprint, token, secret, } => render_show_secret_dialog( Some(config_id), + url.as_deref(), token, secret, - &self.fingerprint, + fingerprint, on_close, ), } diff --git a/ui/src/remotes/auto_installer/token_panel.rs b/ui/src/remotes/auto_installer/token_panel.rs index d5f1ff7..6744149 100644 --- a/ui/src/remotes/auto_installer/token_panel.rs +++ b/ui/src/remotes/auto_installer/token_panel.rs @@ -224,6 +224,7 @@ impl LoadableComponent for AuthTokenPanelComponent { Self::ViewState::Create => self.create_add_dialog(ctx), Self::ViewState::Edit => self.create_edit_dialog(ctx), Self::ViewState::DisplaySecret { token, secret } => render_show_secret_dialog( + None, None, token, secret, -- 2.47.3