public inbox for yew-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [yew-devel] [PATCH yew-comp] fix #6885: auth_view: select appropriate base url for removing realms
@ 2025-10-02 14:35 Shannon Sterz
  2025-10-03  5:39 ` [yew-devel] applied: " Dietmar Maurer
  0 siblings, 1 reply; 2+ messages in thread
From: Shannon Sterz @ 2025-10-02 14:35 UTC (permalink / raw)
  To: yew-devel

previously trying to remove a realm failed because the base_url to
query realms is not the same for removing a realm. the later depends
on the type of the realm, so query the type to get the appropriate
url.

Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=6885
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 src/auth_view.rs | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/auth_view.rs b/src/auth_view.rs
index f957e65..aac08e0 100644
--- a/src/auth_view.rs
+++ b/src/auth_view.rs
@@ -203,13 +203,22 @@ impl LoadableComponent for ProxmoxAuthView {
         match msg {
             Msg::Redraw => true,
             Msg::Remove => {
-                let info = match self.get_selected_record() {
-                    Some(info) => info,
-                    None => return true,
+                let Some(info) = self.get_selected_record() else {
+                    return true;
+                };
+
+                let base_url = match info.ty.as_str() {
+                    "openid" => &props.openid_base_url,
+                    "ldap" => &props.ldap_base_url,
+                    "ad" => &props.ad_base_url,
+                    _ => return true,
+                };
+
+                let Some(base_url) = base_url.clone() else {
+                    return true;
                 };
 
                 let link = ctx.link();
-                let base_url = props.base_url.clone();
                 link.clone().spawn(async move {
                     if let Err(err) = delete_item(base_url, info.realm.into()).await {
                         link.show_error(tr!("Unable to delete item"), err, true);
-- 
2.47.3



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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [yew-devel] applied: [PATCH yew-comp] fix #6885: auth_view: select appropriate base url for removing realms
  2025-10-02 14:35 [yew-devel] [PATCH yew-comp] fix #6885: auth_view: select appropriate base url for removing realms Shannon Sterz
@ 2025-10-03  5:39 ` Dietmar Maurer
  0 siblings, 0 replies; 2+ messages in thread
From: Dietmar Maurer @ 2025-10-03  5:39 UTC (permalink / raw)
  To: Yew framework devel list at Proxmox


[-- Attachment #1.1: Type: text/plain, Size: 7 bytes --]

applied

[-- Attachment #1.2: Type: text/html, Size: 319 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-03  5:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-02 14:35 [yew-devel] [PATCH yew-comp] fix #6885: auth_view: select appropriate base url for removing realms Shannon Sterz
2025-10-03  5:39 ` [yew-devel] applied: " Dietmar Maurer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal