From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <pdm-devel-bounces@lists.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
	by lore.proxmox.com (Postfix) with ESMTPS id DC5D11FF164
	for <inbox@lore.proxmox.com>; Fri, 25 Apr 2025 14:13:16 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
	by firstgate.proxmox.com (Proxmox) with ESMTP id AC75932183;
	Fri, 25 Apr 2025 14:13:24 +0200 (CEST)
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Date: Fri, 25 Apr 2025 14:12:50 +0200
Message-Id: <20250425121250.3632516-1-d.csapak@proxmox.com>
X-Mailer: git-send-email 2.39.5
MIME-Version: 1.0
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.022 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
Subject: [pdm-devel] [PATCH datacenter-manager] ui: pve tree: add tooltips
 for inline actions
X-BeenThere: pdm-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Datacenter Manager development discussion
 <pdm-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pdm-devel>, 
 <mailto:pdm-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pdm-devel/>
List-Post: <mailto:pdm-devel@lists.proxmox.com>
List-Help: <mailto:pdm-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel>, 
 <mailto:pdm-devel-request@lists.proxmox.com?subject=subscribe>
Reply-To: Proxmox Datacenter Manager development discussion
 <pdm-devel@lists.proxmox.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: pdm-devel-bounces@lists.proxmox.com
Sender: "pdm-devel" <pdm-devel-bounces@lists.proxmox.com>

So users get a textual feedback on the actions too.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 ui/src/pve/tree.rs | 94 ++++++++++++++++++++++++++--------------------
 1 file changed, 54 insertions(+), 40 deletions(-)

diff --git a/ui/src/pve/tree.rs b/ui/src/pve/tree.rs
index e74b187..b6f03d7 100644
--- a/ui/src/pve/tree.rs
+++ b/ui/src/pve/tree.rs
@@ -16,7 +16,8 @@ use pwt::state::{KeyedSlabTree, NavigationContext, NavigationContextExt, Selecti
 use pwt::widget::{
     data_table::{DataTable, DataTableColumn, DataTableHeader},
     form::Field,
-    ActionIcon, Column, Container, Fa, MessageBox, MessageBoxButtons, Row, Toolbar, Trigger,
+    ActionIcon, Column, Container, Fa, MessageBox, MessageBoxButtons, Row, Toolbar, Tooltip,
+    Trigger,
 };
 use pwt::{prelude::*, widget::Button};
 
@@ -609,54 +610,67 @@ fn columns(
                     .class(JustifyContent::FlexEnd)
                     .with_optional_child(guest_info.map(|(_, status)| {
                         let disabled = status != "running";
-                        ActionIcon::new("fa fa-fw fa-power-off")
-                            .disabled(disabled)
-                            .on_activate({
-                                let id = id.to_string();
-                                let link = link.clone();
-                                move |_| {
-                                    link.change_view(Some(ViewState::Confirm(
-                                        Action::Shutdown,
-                                        id.to_string(),
-                                    )))
-                                }
-                            })
-                            .class((!disabled).then_some(ColorScheme::Error))
+                        Tooltip::new(
+                            ActionIcon::new("fa fa-fw fa-power-off")
+                                .disabled(disabled)
+                                .on_activate({
+                                    let id = id.to_string();
+                                    let link = link.clone();
+                                    move |_| {
+                                        link.change_view(Some(ViewState::Confirm(
+                                            Action::Shutdown,
+                                            id.to_string(),
+                                        )))
+                                    }
+                                })
+                                .class((!disabled).then_some(ColorScheme::Error)),
+                        )
+                        .tip(tr!("Shutdown"))
                     }))
                     .with_optional_child(guest_info.map(|(_, status)| {
                         let disabled = status == "running";
-                        ActionIcon::new("fa fa-fw fa-play")
-                            .disabled(disabled)
-                            .on_activate({
-                                let id = id.to_string();
-                                let link = link.clone();
-                                move |_| {
-                                    link.change_view(Some(ViewState::Confirm(
-                                        Action::Start,
-                                        id.to_string(),
-                                    )));
-                                }
-                            })
-                            .class((!disabled).then_some(ColorScheme::Success))
+                        Tooltip::new(
+                            ActionIcon::new("fa fa-fw fa-play")
+                                .disabled(disabled)
+                                .on_activate({
+                                    let id = id.to_string();
+                                    let link = link.clone();
+                                    move |_| {
+                                        link.change_view(Some(ViewState::Confirm(
+                                            Action::Start,
+                                            id.to_string(),
+                                        )));
+                                    }
+                                })
+                                .class((!disabled).then_some(ColorScheme::Success)),
+                        )
+                        .tip(tr!("Start"))
                     }))
                     .with_optional_child(guest_info.map(|(guest_info, _)| {
-                        ActionIcon::new("fa fa-fw fa-paper-plane-o").on_activate({
+                        Tooltip::new(ActionIcon::new("fa fa-fw fa-paper-plane-o").on_activate({
                             let link = link.clone();
                             move |_| link.change_view(Some(ViewState::MigrateWindow(guest_info)))
-                        })
+                        }))
+                        .tip(tr!("Migrate"))
                     }))
-                    .with_child(ActionIcon::new("fa fa-external-link").on_activate({
-                        let link = link.clone();
-                        let remote = remote.clone();
-                        move |()| {
-                            // there must be a remote with a connections config if were already here
-                            if let Some(url) =
-                                get_deep_url(link.yew_link(), &remote, node.as_deref(), &local_id)
-                            {
-                                let _ = window().open_with_url(&url.href());
+                    .with_child(
+                        Tooltip::new(ActionIcon::new("fa fa-external-link").on_activate({
+                            let link = link.clone();
+                            let remote = remote.clone();
+                            move |()| {
+                                // there must be a remote with a connections config if were already here
+                                if let Some(url) = get_deep_url(
+                                    link.yew_link(),
+                                    &remote,
+                                    node.as_deref(),
+                                    &local_id,
+                                ) {
+                                    let _ = window().open_with_url(&url.href());
+                                }
                             }
-                        }
-                    }))
+                        }))
+                        .tip(tr!("Open in PVE UI")),
+                    )
                     .into()
             })
             .into(),
-- 
2.39.5



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