all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager 7/7] ui: widgets: remote realm selector: support PBS remotes
Date: Mon, 29 Dec 2025 14:44:45 +0100	[thread overview]
Message-ID: <20251229134445.286401-8-l.wagner@proxmox.com> (raw)
In-Reply-To: <20251229134445.286401-1-l.wagner@proxmox.com>

This is achieved by adding a new 'remote_type' property.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 ui/src/remotes/wizard_page_info.rs     |  2 +-
 ui/src/widget/remote_realm_selector.rs | 10 +++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ui/src/remotes/wizard_page_info.rs b/ui/src/remotes/wizard_page_info.rs
index 8a115b4a..fc9bfb01 100644
--- a/ui/src/remotes/wizard_page_info.rs
+++ b/ui/src/remotes/wizard_page_info.rs
@@ -331,7 +331,7 @@ impl Component for PdmWizardPageInfo {
             )
             .with_field(
                 tr!("Realm"),
-                RemoteRealmSelector::new(hostname, fingerprint)
+                RemoteRealmSelector::new(hostname, fingerprint, props.remote_type)
                     .name("realm")
                     .disabled(!self.user_mode)
                     .required(self.user_mode),
diff --git a/ui/src/widget/remote_realm_selector.rs b/ui/src/widget/remote_realm_selector.rs
index 7ba8c633..3de95568 100644
--- a/ui/src/widget/remote_realm_selector.rs
+++ b/ui/src/widget/remote_realm_selector.rs
@@ -16,6 +16,8 @@ use proxmox_yew_comp::percent_encoding::percent_encode_component;
 use pwt::props::{FieldBuilder, WidgetBuilder};
 use pwt_macros::{builder, widget};
 
+use pdm_api_types::remotes::RemoteType;
+
 #[widget(comp=RemoteRealmSelectorComp, @input)]
 #[derive(Clone, Properties, PartialEq)]
 #[builder]
@@ -30,6 +32,9 @@ pub struct RemoteRealmSelector {
 
     /// Optional fingerprint of the remote.
     pub fingerprint: Option<AttrValue>,
+
+    /// Type of the remote.
+    pub remote_type: RemoteType,
 }
 
 impl RemoteRealmSelector {
@@ -37,10 +42,12 @@ impl RemoteRealmSelector {
     pub fn new(
         hostname: impl IntoPropValue<AttrValue>,
         fingerprint: impl IntoPropValue<Option<AttrValue>>,
+        remote_type: RemoteType,
     ) -> Self {
         yew::props!(Self {
             hostname: hostname.into_prop_value(),
             fingerprint: fingerprint.into_prop_value(),
+            remote_type,
         })
     }
 }
@@ -89,7 +96,8 @@ impl Component for RemoteRealmSelectorComp {
         let props = ctx.props();
 
         let mut url = format!(
-            "/pve/realms?hostname={}",
+            "/{}/realms?hostname={}",
+            props.remote_type,
             percent_encode_component(&props.hostname)
         );
         if let Some(fp) = &props.fingerprint {
-- 
2.47.3



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


      parent reply	other threads:[~2025-12-29 13:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-29 13:44 [pdm-devel] [PATCH datacenter-manager 0/7] fix #7192: properly enumerate PBS realms in 'Add Remote' wizard Lukas Wagner
2025-12-29 13:44 ` [pdm-devel] [PATCH datacenter-manager 1/7] pbs-client: add `list_domains` Lukas Wagner
2025-12-29 13:44 ` [pdm-devel] [PATCH datacenter-manager 2/7] api: pbs: add /pbs/realms endpoint Lukas Wagner
2025-12-29 13:44 ` [pdm-devel] [PATCH datacenter-manager 3/7] ui: rename pve_realm_selector module to remote_realm_selector Lukas Wagner
2025-12-29 13:44 ` [pdm-devel] [PATCH datacenter-manager 4/7] ui: widgets: rename PveRealmSelector to RemoteRealmSelector Lukas Wagner
2025-12-29 13:44 ` [pdm-devel] [PATCH datacenter-manager 5/7] ui: widgets: make RemoteRealmSelectorComp private Lukas Wagner
2025-12-29 13:44 ` [pdm-devel] [PATCH datacenter-manager 6/7] ui: widget: remote realm selector: add missing docstrings Lukas Wagner
2025-12-29 13:44 ` Lukas Wagner [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=20251229134445.286401-8-l.wagner@proxmox.com \
    --to=l.wagner@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