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 468CF1FF187 for ; Mon, 22 Sep 2025 17:05:06 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 17D101F56D; Mon, 22 Sep 2025 17:05:29 +0200 (CEST) From: Shannon Sterz To: pdm-devel@lists.proxmox.com Date: Mon, 22 Sep 2025 17:05:13 +0200 Message-ID: <20250922150519.399573-8-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250922150519.399573-1-s.sterz@proxmox.com> References: <20250922150519.399573-1-s.sterz@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1758553511045 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.058 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: [pdm-devel] [PATCH yew-comp v2 6/6] auth_edit_ldap: improve form layout and placeholders 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" make certain field large as they may contain too much information to fit into a small field. also switches usages of `company.net` to `exmaple.com` in compliance with rfc2606 [1]. also hides the bind dn's placeholder if anonymous search is enabled to not give the impression that a default value is used for the bind dn. [1]: https://datatracker.ietf.org/doc/html/rfc2606 Suggested-by: Christoph Hess Signed-off-by: Shannon Sterz --- src/auth_edit_ldap.rs | 78 +++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/src/auth_edit_ldap.rs b/src/auth_edit_ldap.rs index 70fb638..19ca02e 100644 --- a/src/auth_edit_ldap.rs +++ b/src/auth_edit_ldap.rs @@ -236,17 +236,23 @@ fn render_sync_form(_form_ctx: FormContext, _props: AuthEditLDAP) -> Html { .padding_top(2) .with_child(tr!("Remove Vanished Options")), ) - .with_field( - tr!("Remove ACLs of vanished users"), - Checkbox::new().name("remove-vanished-acl"), + .with_large_field( + tr!("ACLs"), + Checkbox::new() + .name("remove-vanished-acl") + .box_label(tr!("Remove ACLs of vanished users.")), ) - .with_field( - tr!("Remove vanished user"), - Checkbox::new().name("remove-vanished-entry"), + .with_large_field( + tr!("Entries"), + Checkbox::new() + .name("remove-vanished-entry") + .box_label(tr!("Remove vanished user")), ) - .with_field( - tr!("Remove vanished properties"), - Checkbox::new().name("remove-vanished-properties"), + .with_large_field( + tr!("Properties"), + Checkbox::new() + .name("remove-vanished-properties") + .box_label(tr!("Remove vanished properties")), ) .into() } @@ -281,16 +287,23 @@ fn render_general_form(form_ctx: FormContext, props: AuthEditLDAP) -> Html { .submit(!is_edit), ) .with_right_field(tr!("Server"), Field::new().name("server1").required(true)) - .with_field(tr!("Default Realm"), Checkbox::new().name("default")); + .with_field( + tr!("Port"), + Number::::new() + .name("port") + .placeholder(tr!("Default")) + .min(1), + ) + .with_right_field(tr!("Fallback Server"), Field::new().name("server2")); if !props.ad_realm.unwrap_or_default() { input_panel = input_panel - .with_field( + .with_large_field( tr!("Base Domain Name"), Field::new() .name("base-dn") .required(true) - .placeholder("cn=Users,dc=company,dc=net"), + .placeholder("cn=Users,dc=example,dc=com"), ) .with_field( tr!("User Attribute Name"), @@ -302,21 +315,6 @@ fn render_general_form(form_ctx: FormContext, props: AuthEditLDAP) -> Html { } input_panel - .with_right_field(tr!("Fallback Server"), Field::new().name("server2")) - .with_right_field( - tr!("Port"), - Number::::new() - .name("port") - .placeholder(tr!("Default")) - .min(1), - ) - .with_field( - tr!("Anonymous Search"), - Checkbox::new() - .name("anonymous_search") - .submit(false) - .default(true), - ) .with_right_field( tr!("Mode"), Combobox::new() @@ -334,24 +332,32 @@ fn render_general_form(form_ctx: FormContext, props: AuthEditLDAP) -> Html { html! {text} }), ) + .with_right_field( + tr!("Verify Certificate"), + Checkbox::new().name("verify").disabled(!tls_enabled), + ) + .with_field(tr!("Default Realm"), Checkbox::new().name("default")) .with_field( + tr!("Anonymous Search"), + Checkbox::new() + .name("anonymous_search") + .submit(false) + .default(true), + ) + .with_large_field( tr!("Bind Domain Name"), Field::new() .name("bind-dn") .required(!anonymous_search) .disabled(anonymous_search) - .placeholder( + .placeholder((!anonymous_search).then(|| { props .ad_realm - .map(|_| "user@company.net") - .unwrap_or("cn=user,dc=company,dc=net"), - ), + .map(|_| "user@example.com") + .unwrap_or("cn=user,dc=example,dc=com") + })), ) - .with_right_field( - tr!("Verify Certificate"), - Checkbox::new().name("verify").disabled(!tls_enabled), - ) - .with_field( + .with_large_field( tr!("Bind Password"), Field::new() .name("password") -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel