* [pdm-devel] [PATCH datacenter-manager 1/2] ui: remote endpoint selector: remove leftover debug log
@ 2025-06-06 7:23 Dominik Csapak
2025-06-06 7:23 ` [pdm-devel] [PATCH datacenter-manager 2/2] ui: use on_activate for buttons Dominik Csapak
0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2025-06-06 7:23 UTC (permalink / raw)
To: pdm-devel
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
ui/src/widget/remote_endpoint_selector.rs | 1 -
1 file changed, 1 deletion(-)
diff --git a/ui/src/widget/remote_endpoint_selector.rs b/ui/src/widget/remote_endpoint_selector.rs
index 779d98c..f7e0fac 100644
--- a/ui/src/widget/remote_endpoint_selector.rs
+++ b/ui/src/widget/remote_endpoint_selector.rs
@@ -84,7 +84,6 @@ impl Component for PdmEndpointSelector {
fn changed(&mut self, ctx: &yew::Context<Self>, old_props: &Self::Properties) -> bool {
if ctx.props().remote != old_props.remote {
- log::info!("{} {}", ctx.props().remote, old_props.remote);
self.update_endpoint_list(ctx);
}
true
--
2.39.5
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pdm-devel] [PATCH datacenter-manager 2/2] ui: use on_activate for buttons
2025-06-06 7:23 [pdm-devel] [PATCH datacenter-manager 1/2] ui: remote endpoint selector: remove leftover debug log Dominik Csapak
@ 2025-06-06 7:23 ` Dominik Csapak
0 siblings, 0 replies; 2+ messages in thread
From: Dominik Csapak @ 2025-06-06 7:23 UTC (permalink / raw)
To: pdm-devel
While it's technically the same currently, 'on_activate' is the correct
interface from our widget-toolkit. 'onclick' behaves the same due to
browser behavior for buttons, but when seeing 'onclick' one could be
lead to use that also for e.g. ActionIcons, where 'onclick' and
'on_activate' is not the same. So for consistency, use on_activate for
buttons everywhere.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
ui/src/configuration/webauthn.rs | 2 +-
ui/src/dashboard/mod.rs | 2 +-
ui/src/pve/mod.rs | 2 +-
ui/src/pve/tree.rs | 2 +-
ui/src/remotes/config.rs | 4 +++-
ui/src/remotes/node_url_list.rs | 2 +-
ui/src/remotes/wizard_page_connect.rs | 2 +-
ui/src/remotes/wizard_page_info.rs | 2 +-
ui/src/top_nav_bar.rs | 4 ++--
9 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/ui/src/configuration/webauthn.rs b/ui/src/configuration/webauthn.rs
index e589c7d..82425f1 100644
--- a/ui/src/configuration/webauthn.rs
+++ b/ui/src/configuration/webauthn.rs
@@ -124,7 +124,7 @@ impl Component for PdmWebauthnConfigEditor {
Button::new(tr!("Auto-fill"))
.class(ColorScheme::Primary)
.icon_class("fa fa-fw fa-pencil-square-o")
- .onclick(ctx.link().callback(move |event: MouseEvent| {
+ .on_activate(ctx.link().callback(move |event: MouseEvent| {
event.stop_propagation();
Msg::AutoFill
})),
diff --git a/ui/src/dashboard/mod.rs b/ui/src/dashboard/mod.rs
index 23ff6b7..044bc1a 100644
--- a/ui/src/dashboard/mod.rs
+++ b/ui/src/dashboard/mod.rs
@@ -255,7 +255,7 @@ impl Component for PdmDashboard {
.with_tool(
Button::new(tr!("Add"))
.icon_class("fa fa-plus-circle")
- .onclick(ctx.link().callback(|_| Msg::CreateWizard(true))),
+ .on_activate(ctx.link().callback(|_| Msg::CreateWizard(true))),
)
.with_child(RemotePanel::new(
(!self.loading).then_some(self.status.clone()),
diff --git a/ui/src/pve/mod.rs b/ui/src/pve/mod.rs
index c5a83cf..a3cf573 100644
--- a/ui/src/pve/mod.rs
+++ b/ui/src/pve/mod.rs
@@ -186,7 +186,7 @@ impl LoadableComponent for PveRemoteComp {
.with_tool(
Button::new(tr!("Open Web UI"))
.icon_class("fa fa-external-link")
- .onclick({
+ .on_activate({
let link = ctx.link().clone();
let remote = ctx.props().remote.clone();
move |_| {
diff --git a/ui/src/pve/tree.rs b/ui/src/pve/tree.rs
index 474c9f2..c4d1322 100644
--- a/ui/src/pve/tree.rs
+++ b/ui/src/pve/tree.rs
@@ -448,7 +448,7 @@ impl LoadableComponent for PveTreeComp {
.on_input(link.callback(Msg::Filter)),
)
.with_flex_spacer()
- .with_child(Button::refresh(ctx.props().loading).onclick({
+ .with_child(Button::refresh(ctx.props().loading).on_activate({
let on_reload_click = ctx.props().on_reload_click.clone();
move |_| {
on_reload_click.emit(());
diff --git a/ui/src/remotes/config.rs b/ui/src/remotes/config.rs
index d9d16ae..db5646b 100644
--- a/ui/src/remotes/config.rs
+++ b/ui/src/remotes/config.rs
@@ -175,7 +175,9 @@ impl LoadableComponent for PbsRemoteConfigPanel {
.with_child({
Button::new(tr!("Add Proxmox VE"))
.icon_class("fa fa-building")
- .onclick(link.change_view_callback(|_| Some(ViewState::Add(RemoteType::Pve))))
+ .on_activate(
+ link.change_view_callback(|_| Some(ViewState::Add(RemoteType::Pve))),
+ )
// FIXME: add PBS support
//MenuButton::new(tr!("Add")).show_arrow(true).menu(
// Menu::new()
diff --git a/ui/src/remotes/node_url_list.rs b/ui/src/remotes/node_url_list.rs
index 54dbfb9..a3de0dc 100644
--- a/ui/src/remotes/node_url_list.rs
+++ b/ui/src/remotes/node_url_list.rs
@@ -197,7 +197,7 @@ impl ManagedField for PdmNodeUrlField {
Button::new(tr!("Add"))
.class(css::ColorScheme::Primary)
.icon_class("fa fa-plus-circle")
- .onclick({
+ .on_activate({
let nodes = self.store.clone();
move |_| {
let mut nodes = nodes.write();
diff --git a/ui/src/remotes/wizard_page_connect.rs b/ui/src/remotes/wizard_page_connect.rs
index 28f14bf..1fb865f 100644
--- a/ui/src/remotes/wizard_page_connect.rs
+++ b/ui/src/remotes/wizard_page_connect.rs
@@ -223,7 +223,7 @@ impl Component for PdmWizardPageConnect {
.with_child(
Button::new("Connect")
.disabled(!self.form_valid)
- .onclick(ctx.link().callback(|_| Msg::Connect)),
+ .on_activate(ctx.link().callback(|_| Msg::Connect)),
),
),
);
diff --git a/ui/src/remotes/wizard_page_info.rs b/ui/src/remotes/wizard_page_info.rs
index b0a5ba2..b272be6 100644
--- a/ui/src/remotes/wizard_page_info.rs
+++ b/ui/src/remotes/wizard_page_info.rs
@@ -344,7 +344,7 @@ impl Component for PdmWizardPageInfo {
.with_child(
Button::new("Scan")
.disabled(self.credentials.is_none())
- .onclick(ctx.link().callback(|_| Msg::Connect)),
+ .on_activate(ctx.link().callback(|_| Msg::Connect)),
),
);
Mask::new(content)
diff --git a/ui/src/top_nav_bar.rs b/ui/src/top_nav_bar.rs
index 07b3b23..78aace5 100644
--- a/ui/src/top_nav_bar.rs
+++ b/ui/src/top_nav_bar.rs
@@ -197,12 +197,12 @@ impl Component for PdmTopNavBar {
.buttons(vec![
Button::new(tr!("Show Local Tasks"))
.class(ColorScheme::Primary)
- .onclick(move |_| {
+ .on_activate(move |_| {
set_location_href("#/administration/tasks");
}),
Button::new(tr!("Show Remote Tasks"))
.class(ColorScheme::Primary)
- .onclick(move |_| {
+ .on_activate(move |_| {
set_location_href("#/remotes/tasks");
}),
])
--
2.39.5
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-06 7:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-06 7:23 [pdm-devel] [PATCH datacenter-manager 1/2] ui: remote endpoint selector: remove leftover debug log Dominik Csapak
2025-06-06 7:23 ` [pdm-devel] [PATCH datacenter-manager 2/2] ui: use on_activate for buttons Dominik Csapak
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