all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: Proxmox Datacenter Manager development discussion
	<pdm-devel@lists.proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pdm-devel] [PATCH datacenter-manager] ui: pbs wizard: strip http(s):// prefix on remote creation
Date: Tue, 14 Oct 2025 10:55:43 +0200	[thread overview]
Message-ID: <0e963ca7-b8ad-4743-958f-043c7c81b237@proxmox.com> (raw)
In-Reply-To: <20251014071221.454180-1-d.csapak@proxmox.com>

On 10/14/25 9:12 AM, Dominik Csapak wrote:
> by reusing our 'normalize_hostname' helper. Move that to the remote
> module, make it (crate) public, and use it for the case when we don't
> have a nodes list (which is only pbs at the moment).
> 
> This strips the 'http(s)://' prefix when submitting the remote to the
> backend, and preventing the 'invalid uri character' error there.
> 
> Reported in the forum:
> https://forum.proxmox.com/threads/cant-add-proxmox-backup-server-node.173560/
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---

Changes look good to me and fix the issue.

Only one small nit: The PBS remote add wizard summary page still shows 
the non-striped hostname, the host to be added has it however stripped.

Would it make sense to update the field text in the connect page, not 
just the ConnectParams? We do already update the fingerprint before the 
`call_on_connect_change()` invocation, so something like the diff below 
should do just that.

```
--- a/ui/src/remotes/wizard_page_connect.rs
+++ b/ui/src/remotes/wizard_page_connect.rs
@@ -211,6 +211,11 @@ impl Component for PdmWizardPageConnect {
                              Some(info.clone())
                          }
                      };
+                    let raw_hostname = 
props.info.form_ctx.read().get_field_text("hostname");
+                    props.info.form_ctx.write().set_field_value(
+                        "hostname",
+                        normalize_hostname(raw_hostname).into(),
+                    );
                      call_on_connect_change(props, connection);
                      self.scan_result = None;
                      props.info.reset_remaining_valid_pages();
```

But this is cosmetic only.

Consider:

Reviewed-by: Christian Ebner <c.ebner@proxmox.com>
Tested-by: Christian Ebner <c.ebner@proxmox.com>


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


      reply	other threads:[~2025-10-14  8:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14  7:11 Dominik Csapak
2025-10-14  8:55 ` Christian Ebner [this message]

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=0e963ca7-b8ad-4743-958f-043c7c81b237@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=d.csapak@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal