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 DAD941FF179 for ; Wed, 29 Oct 2025 14:46:12 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D0B52BF95; Wed, 29 Oct 2025 14:46:45 +0100 (CET) From: Fiona Ebner To: pdm-devel@lists.proxmox.com Date: Wed, 29 Oct 2025 14:46:27 +0100 Message-ID: <20251029134638.125532-2-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029134638.125532-1-f.ebner@proxmox.com> References: <20251029134638.125532-1-f.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761745589137 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.020 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 Subject: [pdm-devel] [PATCH datacenter-manager 1/1] ui: remote wizard: validate remote ID X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" As reported in the community forum [0], the remote ID field in the remote wizard was not validated. When using an inavlid remote ID, only the backend would report an error upon submission. Add validation to the 'Remote ID' field to catch this early. [0]: https://forum.proxmox.com/threads/171742/post-808943 Signed-off-by: Fiona Ebner --- ui/src/remotes/wizard_page_info.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/src/remotes/wizard_page_info.rs b/ui/src/remotes/wizard_page_info.rs index 7fffdd1..8bcd1b3 100644 --- a/ui/src/remotes/wizard_page_info.rs +++ b/ui/src/remotes/wizard_page_info.rs @@ -6,7 +6,7 @@ use serde::{Deserialize, Serialize}; use yew::virtual_dom::{Key, VComp, VNode}; use proxmox_schema::property_string::PropertyString; -use proxmox_yew_comp::WizardPageRenderInfo; +use proxmox_yew_comp::{SchemaValidation, WizardPageRenderInfo}; use pwt::{ css::{self, FlexFit}, prelude::*, @@ -18,7 +18,7 @@ use pwt::{ AsyncPool, }; -use pdm_api_types::remotes::{NodeUrl, Remote, RemoteType}; +use pdm_api_types::remotes::{NodeUrl, Remote, RemoteType, REMOTE_ID_SCHEMA}; use pwt_macros::builder; @@ -292,7 +292,13 @@ impl Component for PdmWizardPageInfo { let input_panel = InputPanel::new() .class(FlexFit) .padding(4) - .with_field(tr!("Remote ID"), Field::new().name("id").required(true)) + .with_field( + tr!("Remote ID"), + Field::new() + .name("id") + .required(true) + .schema(&REMOTE_ID_SCHEMA), + ) .with_custom_child( RadioButton::new("login") .key("login-mode-login") -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel