[pdm-devel] [PATCH datacenter-manager 1/1] ui: remote wizard: validate remote ID
Fiona Ebner
f.ebner at proxmox.com
Wed Oct 29 14:46:27 CET 2025
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 <f.ebner at proxmox.com>
---
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
More information about the pdm-devel
mailing list