all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager] ui: remotes: add navigation router to tab panels
Date: Fri, 28 Nov 2025 11:46:23 +0100	[thread overview]
Message-ID: <20251128104629.1800904-1-d.csapak@proxmox.com> (raw)

that way the state is preserved across reloads and the changes are
recorded in the browser history.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 ui/src/pbs/datastore.rs | 3 +++
 ui/src/pbs/mod.rs       | 2 ++
 ui/src/pbs/node/mod.rs  | 1 +
 ui/src/pve/lxc/mod.rs   | 1 +
 ui/src/pve/mod.rs       | 1 +
 ui/src/pve/node/mod.rs  | 1 +
 ui/src/pve/qemu/mod.rs  | 1 +
 7 files changed, 10 insertions(+)

diff --git a/ui/src/pbs/datastore.rs b/ui/src/pbs/datastore.rs
index 3d4e6b6e..274c6ef9 100644
--- a/ui/src/pbs/datastore.rs
+++ b/ui/src/pbs/datastore.rs
@@ -46,10 +46,12 @@ impl Component for DatastorePanelComp {
     fn view(&self, ctx: &yew::Context<Self>) -> yew::Html {
         let props = ctx.props();
         pwt::widget::TabPanel::new()
+            .router(true)
             .class(FlexFit)
             .title(tr!("Datastore {0}", props.config.name))
             .with_item_builder(
                 TabBarItem::new()
+                    .key("overview")
                     .label(tr!("Overview"))
                     .icon_class("fa fa-tachometer"),
                 {
@@ -60,6 +62,7 @@ impl Component for DatastorePanelComp {
             )
             .with_item_builder(
                 TabBarItem::new()
+                    .key("content")
                     .label(tr!("Content"))
                     .icon_class("fa fa-th"),
                 {
diff --git a/ui/src/pbs/mod.rs b/ui/src/pbs/mod.rs
index 75ed9926..d14809c2 100644
--- a/ui/src/pbs/mod.rs
+++ b/ui/src/pbs/mod.rs
@@ -114,6 +114,8 @@ impl LoadableComponent for PbsRemoteComp {
             }
         };
 
+        let content = NavigationContainer::new().with_child(content);
+
         let title: Html = Row::new()
             .gap(2)
             .class(AlignItems::Center)
diff --git a/ui/src/pbs/node/mod.rs b/ui/src/pbs/node/mod.rs
index bab5727c..2033bb14 100644
--- a/ui/src/pbs/node/mod.rs
+++ b/ui/src/pbs/node/mod.rs
@@ -64,6 +64,7 @@ impl yew::Component for PbsNodePanelComp {
             .into();
 
         TabPanel::new()
+            .router(true)
             .class(pwt::css::FlexFit)
             .title(title)
             .class(ColorScheme::Neutral)
diff --git a/ui/src/pve/lxc/mod.rs b/ui/src/pve/lxc/mod.rs
index 3d983a08..97c4d083 100644
--- a/ui/src/pve/lxc/mod.rs
+++ b/ui/src/pve/lxc/mod.rs
@@ -60,6 +60,7 @@ impl yew::Component for LxcPanelComp {
             .into();
 
         TabPanel::new()
+            .router(true)
             .class(pwt::css::FlexFit)
             .title(title)
             .with_item_builder(
diff --git a/ui/src/pve/mod.rs b/ui/src/pve/mod.rs
index 4629077e..afbed5a8 100644
--- a/ui/src/pve/mod.rs
+++ b/ui/src/pve/mod.rs
@@ -200,6 +200,7 @@ impl LoadableComponent for PveRemoteComp {
                     .into()
             }
         };
+        let content = NavigationContainer::new().with_child(content);
 
         let link = ctx.link();
 
diff --git a/ui/src/pve/node/mod.rs b/ui/src/pve/node/mod.rs
index de79185a..66ce8dda 100644
--- a/ui/src/pve/node/mod.rs
+++ b/ui/src/pve/node/mod.rs
@@ -68,6 +68,7 @@ impl yew::Component for PveNodePanelComp {
             .into();
 
         TabPanel::new()
+            .router(true)
             .class(pwt::css::FlexFit)
             .title(title)
             .class(ColorScheme::Neutral)
diff --git a/ui/src/pve/qemu/mod.rs b/ui/src/pve/qemu/mod.rs
index 3b5f01b2..b3388f41 100644
--- a/ui/src/pve/qemu/mod.rs
+++ b/ui/src/pve/qemu/mod.rs
@@ -59,6 +59,7 @@ impl yew::Component for QemuPanelComp {
             .into();
 
         TabPanel::new()
+            .router(true)
             .class(pwt::css::FlexFit)
             .title(title)
             .with_item_builder(
-- 
2.47.3



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


             reply	other threads:[~2025-11-28 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-28 10:46 Dominik Csapak [this message]
2025-11-28 18:39 ` [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=20251128104629.1800904-1-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal