From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 762151FF139 for ; Mon, 12 Jan 2026 11:29:56 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0067F1A813; Mon, 12 Jan 2026 11:29:58 +0100 (CET) Mime-Version: 1.0 Date: Mon, 12 Jan 2026 11:29:55 +0100 Message-Id: From: "Lukas Wagner" To: "Proxmox Datacenter Manager development discussion" X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20251219123758.151318-1-s.sterz@proxmox.com> <20251219123758.151318-2-s.sterz@proxmox.com> In-Reply-To: <20251219123758.151318-2-s.sterz@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1768213752545 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.038 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pdm-devel] [PATCH datacenter-manager 1/2] ui: node url list: validate list of endpoints 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" On Fri Dec 19, 2025 at 1:37 PM CET, Shannon Sterz wrote: > otherwise user can manually edit these fields. when adding a remote > through a wizzard the api will return an error that the value doesn't > match the validation regex instantly. hence, there it is mostly a ux > issue. > > when editing a remote, however, the api doesn't validate the url. so > adding, for a example a protocol (e.g. "https://") to the hostname/ip > field, will lead to connection errors when looking at the remote's > overview. > > Signed-off-by: Shannon Sterz > --- > lib/pdm-api-types/src/lib.rs | 3 +++ > ui/src/remotes/node_url_list.rs | 2 ++ > 2 files changed, 5 insertions(+) > > diff --git a/lib/pdm-api-types/src/lib.rs b/lib/pdm-api-types/src/lib.rs > index 5daaa3f..d4cc7ef 100644 > --- a/lib/pdm-api-types/src/lib.rs > +++ b/lib/pdm-api-types/src/lib.rs > @@ -137,6 +137,9 @@ pub const HOST_PORT_FORMAT: ApiStringFormat = ApiStringFormat::Pattern(&HOST_POR > pub const HOST_OPTIONAL_PORT_FORMAT: ApiStringFormat = > ApiStringFormat::Pattern(&HOST_OPTIONAL_PORT_REGEX); > pub const HTTP_URL_FORMAT: ApiStringFormat = ApiStringFormat::Pattern(&HTTP_URL_REGEX); > +pub const HOST_OPTIONAL_PORT_SCHEMA: Schema = StringSchema::new("A host with an optional port.") > + .format(&HOST_OPTIONAL_PORT_FORMAT) > + .schema(); > > pub const DAILY_DURATION_FORMAT: ApiStringFormat = > ApiStringFormat::VerifyFn(|s| parse_daily_duration(s).map(drop)); > diff --git a/ui/src/remotes/node_url_list.rs b/ui/src/remotes/node_url_list.rs > index 89999ef..c558022 100644 > --- a/ui/src/remotes/node_url_list.rs > +++ b/ui/src/remotes/node_url_list.rs > @@ -16,6 +16,7 @@ use pwt::{css, prelude::*}; > use proxmox_yew_comp::{SchemaValidation, Status}; > > use pdm_api_types::remotes::NodeUrl; > +use pdm_api_types::HOST_OPTIONAL_PORT_SCHEMA; > use proxmox_schema::property_string::PropertyString; > > use proxmox_schema::api_types::CERT_FINGERPRINT_SHA256_SCHEMA; > @@ -254,6 +255,7 @@ fn columns(ctx: &ManagedFieldContext) -> Rc Field::new() > .on_change(link.callback(move |value| Msg::UpdateHostname(index, value))) > .required(true) > + .schema(HOST_OPTIONAL_PORT_SCHEMA) This requires a reference to compile for me: .schema(&HOST_OPTIONAL_PORT_SCHEMA) > .value(item.data.hostname.clone()) > .into() > } _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel