From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager 4/5] ui: pve: tree: use correct key for the root node
Date: Wed, 10 Sep 2025 13:52:53 +0200 [thread overview]
Message-ID: <20250910115259.3530107-6-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250910115259.3530107-1-d.csapak@proxmox.com>
the default/empty path is '_' so use that to select the root node
not really relevant at the moment since the root node is not visible,
but this makes it work when we change that.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
ui/src/pve/tree.rs | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/ui/src/pve/tree.rs b/ui/src/pve/tree.rs
index f38e0da..c669bab 100644
--- a/ui/src/pve/tree.rs
+++ b/ui/src/pve/tree.rs
@@ -386,11 +386,15 @@ impl LoadableComponent for PveTreeComp {
}
}
Msg::RouteChanged(path) => {
- let key = Key::from(format!(
- "remote/{}/{}",
- ctx.props().remote,
- path.replace("+", "/")
- ));
+ let key = if path == "_" {
+ Key::from("__root__")
+ } else {
+ Key::from(format!(
+ "remote/{}/{}",
+ ctx.props().remote,
+ path.replace("+", "/")
+ ))
+ };
self.view_selection.select(key);
}
Msg::Filter(text) => {
--
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-10 11:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 11:52 [pdm-devel] [PATCH datacenter-manager/yew-comp 0/6] ui: add remote task panel and filtering Dominik Csapak
2025-09-10 11:52 ` [pdm-devel] [PATCH yew-comp 1/1] tasks: add optional fixed filter Dominik Csapak
2025-09-10 12:23 ` [pdm-devel] applied: " Thomas Lamprecht
2025-09-10 11:52 ` [pdm-devel] [PATCH datacenter-manager 1/5] ui: adapt to new node_ref semantic for new pwt Dominik Csapak
2025-09-10 13:50 ` [pdm-devel] applied: " Thomas Lamprecht
2025-09-10 11:52 ` [pdm-devel] [PATCH datacenter-manager 2/5] ui: remote: tasks: add remote filter Dominik Csapak
2025-09-10 13:50 ` [pdm-devel] applied: " Thomas Lamprecht
2025-09-10 11:52 ` [pdm-devel] [PATCH datacenter-manager 3/5] ui: remote: tasks: add optional remote property to filter Dominik Csapak
2025-09-10 13:50 ` [pdm-devel] applied: " Thomas Lamprecht
2025-09-10 11:52 ` Dominik Csapak [this message]
2025-09-10 13:50 ` [pdm-devel] applied: [PATCH datacenter-manager 4/5] ui: pve: tree: use correct key for the root node Thomas Lamprecht
2025-09-10 11:52 ` [pdm-devel] [PATCH datacenter-manager 5/5] ui: pve: tree: add remote tasks panel Dominik Csapak
2025-09-10 13:50 ` [pdm-devel] applied: " Thomas Lamprecht
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=20250910115259.3530107-6-d.csapak@proxmox.com \
--to=d.csapak@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