all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: yew-devel@lists.proxmox.com
Subject: [yew-devel] [PATCH yew-comp 3/4] login panel/realm selector: make realm path configurable
Date: Tue,  1 Jul 2025 10:38:58 +0200	[thread overview]
Message-ID: <20250701083859.2088138-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250701083859.2088138-1-d.csapak@proxmox.com>

sometimes, the path to the publicly available realm list has a different
api path, for example in PMG. To make it usable there, make the path
configurable but default to the old one

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/login_panel.rs    | 6 ++++++
 src/realm_selector.rs | 7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/login_panel.rs b/src/login_panel.rs
index fabe271..3c16ed4 100644
--- a/src/login_panel.rs
+++ b/src/login_panel.rs
@@ -40,6 +40,11 @@ pub struct LoginPanel {
     #[prop_or(false)]
     #[builder]
     pub mobile: bool,
+
+    /// The path to the domain api call, default is defined in the [RealmSelector]
+    #[prop_or_default]
+    #[builder]
+    pub domain_path: Option<AttrValue>,
 }
 
 impl Default for LoginPanel {
@@ -194,6 +199,7 @@ impl ProxmoxLoginPanel {
                 RealmSelector::new()
                     .name("realm")
                     .label_id(realm_label_id)
+                    .path(props.domain_path.clone())
                     .default(default_realm),
             )
             .with_child(
diff --git a/src/realm_selector.rs b/src/realm_selector.rs
index 6522c59..fa144c4 100644
--- a/src/realm_selector.rs
+++ b/src/realm_selector.rs
@@ -42,6 +42,11 @@ pub struct RealmSelector {
     #[builder(IntoPropValue, into_prop_value)]
     #[prop_or_default]
     pub default: Option<AttrValue>,
+
+    /// The path for getting the realm list
+    #[builder]
+    #[prop_or(Some("/access/domains".into()))]
+    pub path: Option<AttrValue>,
 }
 
 impl Default for RealmSelector {
@@ -104,7 +109,7 @@ impl Component for ProxmoxRealmSelector {
             .with_input_props(&props.input_props)
             .required(true)
             .default(props.default.as_deref().unwrap_or("pam").to_string())
-            .loader("/access/domains")
+            .loader(props.path.clone())
             .validate(self.validate.clone())
             .into()
     }
-- 
2.39.5



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


  parent reply	other threads:[~2025-07-01  8:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01  8:38 [yew-devel] [PATCH yew-comp 1/4] expose subscription_note publicly Dominik Csapak
2025-07-01  8:38 ` [yew-devel] [PATCH yew-comp 2/4] http helpers: expose ticket refresh loop controls Dominik Csapak
2025-07-01  8:38 ` Dominik Csapak [this message]
2025-07-01  8:38 ` [yew-devel] [PATCH yew-comp 4/4] login panel: use snackbar for errors when on mobile Dominik Csapak
2025-07-01  9:25 ` [yew-devel] applied: [PATCH yew-comp 1/4] expose subscription_note publicly Dietmar Maurer

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=20250701083859.2088138-3-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=yew-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