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 EE5B91FF141 for ; Fri, 13 Feb 2026 14:21:15 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 97F853BCA; Fri, 13 Feb 2026 14:22:03 +0100 (CET) Content-Type: text/plain; charset=UTF-8 Date: Fri, 13 Feb 2026 14:21:29 +0100 Message-Id: To: "Shan Shaji" , Subject: Re: [PATCH datacenter-manager v3 5/6] fix: ui: add remove confirmation dialog with optional token deletion From: "Lukas Wagner" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20260211152016.445817-1-s.shaji@proxmox.com> <20260211152016.445817-6-s.shaji@proxmox.com> In-Reply-To: <20260211152016.445817-6-s.shaji@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1770988886565 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.036 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: J2GYAWUI6XXMRUQPDQ2HJUS3JMVL7RXY X-Message-ID-Hash: J2GYAWUI6XXMRUQPDQ2HJUS3JMVL7RXY X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi Shan, thanks for the patch. In general, make sure to include the reference to the bugzilla entry in the commit subject as well, as this is the source of truth that will be used to assemble the changelog later. As far as I can tell, the "fix #6914" should probably included in the UI commits as well as the ones adding it to the CLI and API. Some further notes inside. On Wed Feb 11, 2026 at 4:20 PM CET, Shan Shaji wrote: > diff --git a/ui/src/remotes/remove_remote.rs b/ui/src/remotes/remove_remo= te.rs > new file mode 100644 > index 0000000..63b55ee > --- /dev/null > +++ b/ui/src/remotes/remove_remote.rs > @@ -0,0 +1,117 @@ > +use std::rc::Rc; > + > +use yew::html::IntoEventCallback; > +use yew::prelude::*; > +use yew::virtual_dom::{VComp, VNode}; > + > +use pwt::css::{AlignItems, FontColor, JustifyContent}; > +use pwt::prelude::*; > +use pwt::widget::form::Checkbox; > +use pwt::widget::{Button, Column, Container, Dialog, Fa, Row}; > + > +use pwt_macros::builder; > + > +#[derive(PartialEq, Properties)] > +#[builder] > +pub struct RemoveRemote { > + /// A callback for an action that needs to be confirmed by the user. > + #[prop_or_default] > + #[builder_cb(IntoEventCallback, into_event_callback, bool)] > + pub on_confirm: Option>, > + > + /// A callback that will trigger if the user dismisses the dialog. > + #[prop_or_default] > + #[builder_cb(IntoEventCallback, into_event_callback, ())] > + pub on_dismiss: Option>, > +} > + > +impl RemoveRemote { > + pub fn new() -> Self { > + yew::props!(Self {}) > + } > +} > + > +pub enum Msg { > + SelectCheckBox(bool), > +} > + > +pub struct PdmRemoveRemote { > + delete_token: bool, > +} as far as I can tell, neither Msg nor PdmRemoveRemote need to be `pub` > + > +impl Component for PdmRemoveRemote { > + type Message =3D Msg; > + > + type Properties =3D RemoveRemote; > + > + fn create(_ctx: &Context) -> Self { > + Self { > + delete_token: false, > + } > + } > + > + fn update(&mut self, _ctx: &Context, msg: Self::Message) -> bo= ol { > + match msg { > + Msg::SelectCheckBox(v) =3D> { > + self.delete_token =3D v; > + true > + } > + } > + } > + > + fn view(&self, ctx: &Context) -> Html { > + let props =3D ctx.props(); > + let delete_token =3D self.delete_token; > + > + let on_confirm =3D props.on_confirm.clone(); > + let on_dismiss =3D props.on_dismiss.clone(); > + > + Dialog::new(tr!("Confirm")) > + .on_close(on_dismiss.clone()) > + .min_height(100) > + .with_child( > + Column::new() > + .padding(4) > + .gap(2) > + .with_child( > + Row::new() > + .gap(2) > + .class(AlignItems::Center) > + .with_child(Container::new().class("pwt-mess= age-sign").with_child( > + Fa::new("exclamation-triangle").class(Fo= ntColor::Error), > + )) > + .with_child(tr!("Are you sure you want to re= move this remote?")), > + ) > + .with_child( > + Checkbox::new() > + .default(false) > + .box_label(tr!("Delete API token from remote= ")) > + .checked(self.delete_token) > + .on_change(ctx.link().callback(|v| Msg::Sele= ctCheckBox(v))), as already discussed off-list, the alignment of the checkbox/text looks a bit off. I suggested to align it the same way as the "Remove Datastore" confirmation in PBS, there the checkbox's left border is aligned with the start of the text above. > + ) > + .with_child( > + Row::new() > + .gap(2) > + .class(JustifyContent::Center) > + .with_child(Button::new(tr!("Yes")).on_activ= ate(move |_| { > + if let Some(on_confirm) =3D &on_confirm = { > + on_confirm.emit(delete_token); > + } > + })) > + .with_child(Button::new(tr!("No")).on_activa= te(move |_| { > + if let Some(on_dismiss) =3D &on_dismiss = { > + on_dismiss.emit(()); > + } > + })), > + ), > + ) > + .into() > + } > +} > + > +impl From for VNode { > + fn from(val: RemoveRemote) -> Self { > + let comp =3D VComp::new::(Rc::new(val), None); > + VNode::from(comp) > + } > +}