From: Shannon Sterz <s.sterz@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH yew-comp 1/5] auth_view: add default column and allow setting ldap realms as default
Date: Tue, 16 Sep 2025 16:48:18 +0200 [thread overview]
Message-ID: <20250916144827.551806-3-s.sterz@proxmox.com> (raw)
In-Reply-To: <20250916144827.551806-1-s.sterz@proxmox.com>
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
src/auth_edit_ldap.rs | 1 +
src/auth_view.rs | 16 +++++++++++++++-
src/common_api_types.rs | 3 +++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/src/auth_edit_ldap.rs b/src/auth_edit_ldap.rs
index 9e5d3a2..4671a1e 100644
--- a/src/auth_edit_ldap.rs
+++ b/src/auth_edit_ldap.rs
@@ -182,6 +182,7 @@ fn render_general_form(form_ctx: FormContext, props: AuthEditLDAP) -> Html {
.required(true)
.placeholder("cn=Users,dc=company,dc=net"),
)
+ .with_field(tr!("Default Realm"), Checkbox::new().name("default"));
.with_right_field(tr!("Fallback Server"), Field::new().name("server2"))
.with_field(
tr!("User Attribute Name"),
diff --git a/src/auth_view.rs b/src/auth_view.rs
index 4a0f22f..4d6e143 100644
--- a/src/auth_view.rs
+++ b/src/auth_view.rs
@@ -12,7 +12,7 @@ use pwt::state::{Selection, Store};
use pwt::widget::data_table::{DataTable, DataTableColumn, DataTableHeader};
use pwt::widget::menu::{Menu, MenuButton, MenuItem};
-use pwt::widget::{Button, Toolbar};
+use pwt::widget::{Button, Fa, Toolbar};
use pwt_macros::builder;
@@ -298,6 +298,20 @@ thread_local! {
a.ty.cmp(&b.ty)
})
.into(),
+ DataTableColumn::new(tr!("Default"))
+ .width("100px")
+ .render(|item: &BasicRealmInfo| {
+ if item.default.unwrap_or_default() {
+ Fa::new("check").into()
+ } else {
+ Fa::new("times").into()
+ }
+ })
+ .justify("center")
+ .sorter(|a: &BasicRealmInfo, b: &BasicRealmInfo| {
+ a.default.unwrap_or_default().cmp(&b.default.unwrap_or_default())
+ })
+ .into(),
DataTableColumn::new("Comment")
.flex(1)
.render(|record: &BasicRealmInfo| {
diff --git a/src/common_api_types.rs b/src/common_api_types.rs
index 03f7707..c247569 100644
--- a/src/common_api_types.rs
+++ b/src/common_api_types.rs
@@ -14,6 +14,9 @@ pub struct BasicRealmInfo {
pub realm: String,
#[serde(rename = "type")]
pub ty: String,
+ /// True if it is the default realm
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub default: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<String>,
}
--
2.47.3
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-09-16 14:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-16 14:48 [pdm-devel] [PATCH datacenter-manager/proxmox/yew-comp 00/11] Add LDAP and AD realm support to Proxmox Datacenter Manager Shannon Sterz
2025-09-16 14:48 ` [pdm-devel] [PATCH proxmox 1/1] ldap: add types and sync features Shannon Sterz
2025-09-16 14:48 ` Shannon Sterz [this message]
2025-09-16 14:48 ` [pdm-devel] [PATCH yew-comp 2/5] utils: add pdm realm to `get_auth_domain_info` Shannon Sterz
2025-09-16 14:48 ` [pdm-devel] [PATCH yew-comp 3/5] auth_view/auth_edit_ldap: add support for active directory realms Shannon Sterz
2025-09-16 14:48 ` [pdm-devel] [PATCH yew-comp 4/5] auth_edit_ldap: add helpers to properly edit ad & ldap realms Shannon Sterz
2025-09-16 14:48 ` [pdm-devel] [PATCH yew-comp 5/5] auth_view: implement syncing ldap and ad realms Shannon Sterz
2025-09-16 14:48 ` [pdm-devel] [PATCH datacenter-manager 1/5] config: add domain config plugins for " Shannon Sterz
2025-09-16 14:48 ` [pdm-devel] [PATCH datacenter-manager 2/5] server: add ldap and active directory authenticators Shannon Sterz
2025-09-16 14:48 ` [pdm-devel] [PATCH datacenter-manager 3/5] server: api: add api endpoints for configuring ldap & ad realms Shannon Sterz
2025-09-16 14:48 ` [pdm-devel] [PATCH datacenter-manager 4/5] api/auth: add endpoint to start ldap sync jobs Shannon Sterz
2025-09-16 14:48 ` [pdm-devel] [PATCH datacenter-manager 5/5] ui: add a panel to allow handling realms Shannon Sterz
2025-09-19 10:02 ` [pdm-devel] [PATCH datacenter-manager/proxmox/yew-comp 00/11] Add LDAP and AD realm support to Proxmox Datacenter Manager Christoph Heiss
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=20250916144827.551806-3-s.sterz@proxmox.com \
--to=s.sterz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox