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 EB0C61FF16B for ; Tue, 1 Jul 2025 10:38:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4C32C39685; Tue, 1 Jul 2025 10:39:34 +0200 (CEST) From: Dominik Csapak To: yew-devel@lists.proxmox.com Date: Tue, 1 Jul 2025 10:38:58 +0200 Message-Id: <20250701083859.2088138-3-d.csapak@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250701083859.2088138-1-d.csapak@proxmox.com> References: <20250701083859.2088138-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.022 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [yew-devel] [PATCH yew-comp 3/4] login panel/realm selector: make realm path configurable X-BeenThere: yew-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Yew framework devel list at Proxmox List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Yew framework devel list at Proxmox Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: yew-devel-bounces@lists.proxmox.com Sender: "yew-devel" 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 --- 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, } 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, + + /// The path for getting the realm list + #[builder] + #[prop_or(Some("/access/domains".into()))] + pub path: Option, } 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