public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager 1/1] ui: remote wizard: validate remote ID
Date: Wed, 29 Oct 2025 14:46:27 +0100	[thread overview]
Message-ID: <20251029134638.125532-2-f.ebner@proxmox.com> (raw)
In-Reply-To: <20251029134638.125532-1-f.ebner@proxmox.com>

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@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



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  reply	other threads:[~2025-10-29 13:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-29 13:46 [pdm-devel] [PATCH datacenter-manager 0/1] " Fiona Ebner
2025-10-29 13:46 ` Fiona Ebner [this message]
2025-10-29 14:09   ` [pdm-devel] applied: [PATCH datacenter-manager 1/1] " Thomas Lamprecht
2025-10-29 14:20     ` Fiona Ebner
2025-10-29 14:46       ` 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=20251029134638.125532-2-f.ebner@proxmox.com \
    --to=f.ebner@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal