public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview
@ 2025-11-04 14:49 Christian Ebner
  2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox 1/1] pbs-api-types: extend datastore config by backend config parser helper Christian Ebner
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Christian Ebner @ 2025-11-04 14:49 UTC (permalink / raw)
  To: pdm-devel

This patches make removable datastores or datastores with s3 backend be visually
easier to identify in the datastore tree view by adapting the icon accordingly,
using the same ones as already used for the PBS UI.
Further, this information is also exposed in the datastore overview together
with the backing device ID or the endpoint ID, depending on the property.

proxmox:

Christian Ebner (1):
  pbs-api-types: extend datastore config by backend config parser helper

 pbs-api-types/src/datastore.rs | 5 +++++
 1 file changed, 5 insertions(+)


proxmox-datacenter-manager:

Christian Ebner (3):
  ui: indicate removable datastore in overview and show backing device
  ui: indicate s3 datastores in overview and show endpoint id
  ui: datastore tree: indicate datastore type by different icons

 ui/src/pbs/datastore/overview.rs | 17 ++++++++++++++++-
 ui/src/pbs/tree.rs               | 22 +++++++++++++++++-----
 2 files changed, 33 insertions(+), 6 deletions(-)


Summary over all repositories:
  3 files changed, 38 insertions(+), 6 deletions(-)

-- 
Generated by git-murpp 0.8.1


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [pdm-devel] [PATCH proxmox 1/1] pbs-api-types: extend datastore config by backend config parser helper
  2025-11-04 14:49 [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview Christian Ebner
@ 2025-11-04 14:49 ` Christian Ebner
  2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox-datacenter-manager 1/3] ui: indicate removable datastore in overview and show backing device Christian Ebner
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Christian Ebner @ 2025-11-04 14:49 UTC (permalink / raw)
  To: pdm-devel

Adds a helper method to `DataStoreConfig` which will facilitate the
parsing of the `DatastoreBackendConfig`.
This is required several times, so although logically trivial making
this a common helper is justified.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 pbs-api-types/src/datastore.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index a214ac25..97f530ee 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -630,6 +630,11 @@ impl DataStoreConfig {
 
         Ok(())
     }
+
+    /// Parse the datastore backend config from the datastore config
+    pub fn parse_backend_config(&self) -> Result<DatastoreBackendConfig, Error> {
+        self.backend.as_deref().unwrap_or_default().parse()
+    }
 }
 
 #[api(
-- 
2.47.3



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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [pdm-devel] [PATCH proxmox-datacenter-manager 1/3] ui: indicate removable datastore in overview and show backing device
  2025-11-04 14:49 [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview Christian Ebner
  2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox 1/1] pbs-api-types: extend datastore config by backend config parser helper Christian Ebner
@ 2025-11-04 14:49 ` Christian Ebner
  2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox-datacenter-manager 2/3] ui: indicate s3 datastores in overview and show endpoint id Christian Ebner
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Christian Ebner @ 2025-11-04 14:49 UTC (permalink / raw)
  To: pdm-devel

Allows to identify removable datastores and their backing device
easily from the datastore overview.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 ui/src/pbs/datastore/overview.rs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ui/src/pbs/datastore/overview.rs b/ui/src/pbs/datastore/overview.rs
index 14e0add..264ea36 100644
--- a/ui/src/pbs/datastore/overview.rs
+++ b/ui/src/pbs/datastore/overview.rs
@@ -209,6 +209,11 @@ impl yew::Component for DataStoreOverviewComp {
                         StatusRow::new(tr!("Maintenance Mode"))
                             .icon_class("fa fa-fw fa-wrench")
                             .status(mode)
+                    }))
+                    .with_optional_child(props.config.backing_device.as_deref().map(|uuid| {
+                        StatusRow::new(tr!("Removable"))
+                            .icon_class("fa fa-fw fa-plug")
+                            .status(tr!("backing device UUID: {0}", uuid))
                     })),
             )
             .with_child(separator().padding_x(4))
-- 
2.47.3



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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [pdm-devel] [PATCH proxmox-datacenter-manager 2/3] ui: indicate s3 datastores in overview and show endpoint id
  2025-11-04 14:49 [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview Christian Ebner
  2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox 1/1] pbs-api-types: extend datastore config by backend config parser helper Christian Ebner
  2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox-datacenter-manager 1/3] ui: indicate removable datastore in overview and show backing device Christian Ebner
@ 2025-11-04 14:49 ` Christian Ebner
  2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox-datacenter-manager 3/3] ui: datastore tree: indicate datastore type by different icons Christian Ebner
  2025-11-05 16:00 ` [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview Shan Shaji
  4 siblings, 0 replies; 7+ messages in thread
From: Christian Ebner @ 2025-11-04 14:49 UTC (permalink / raw)
  To: pdm-devel

Allows to identify datastores with s3 backend and the used endpoint
id from the datastore overview.

If parsing fails, fallback to the default backend in lack of
alternatives.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 ui/src/pbs/datastore/overview.rs | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/ui/src/pbs/datastore/overview.rs b/ui/src/pbs/datastore/overview.rs
index 264ea36..abb46f1 100644
--- a/ui/src/pbs/datastore/overview.rs
+++ b/ui/src/pbs/datastore/overview.rs
@@ -1,7 +1,7 @@
 use std::rc::Rc;
 
 use gloo_timers::callback::Timeout;
-use pbs_api_types::DataStoreConfig;
+use pbs_api_types::{DataStoreConfig, DatastoreBackendType};
 use yew::{
     virtual_dom::{VComp, VNode},
     Properties,
@@ -179,6 +179,11 @@ impl yew::Component for DataStoreOverviewComp {
 
     fn view(&self, ctx: &yew::Context<Self>) -> yew::Html {
         let props = ctx.props();
+        let backend_config = props.config.parse_backend_config().unwrap_or_default();
+        let backend_s3 = match backend_config.ty.unwrap_or_default() {
+            DatastoreBackendType::Filesystem => None,
+            DatastoreBackendType::S3 => Some(backend_config.client.unwrap_or_default()),
+        };
 
         // TODO get current status via API and show usage, etc.
 
@@ -214,6 +219,11 @@ impl yew::Component for DataStoreOverviewComp {
                         StatusRow::new(tr!("Removable"))
                             .icon_class("fa fa-fw fa-plug")
                             .status(tr!("backing device UUID: {0}", uuid))
+                    }))
+                    .with_optional_child(backend_s3.map(|endpoint| {
+                        StatusRow::new(tr!("S3"))
+                            .icon_class("fa fa-fw fa-cloud-upload")
+                            .status(tr!("using endpoint: {0}", endpoint))
                     })),
             )
             .with_child(separator().padding_x(4))
-- 
2.47.3



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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [pdm-devel] [PATCH proxmox-datacenter-manager 3/3] ui: datastore tree: indicate datastore type by different icons
  2025-11-04 14:49 [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview Christian Ebner
                   ` (2 preceding siblings ...)
  2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox-datacenter-manager 2/3] ui: indicate s3 datastores in overview and show endpoint id Christian Ebner
@ 2025-11-04 14:49 ` Christian Ebner
  2025-11-05 16:00 ` [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview Shan Shaji
  4 siblings, 0 replies; 7+ messages in thread
From: Christian Ebner @ 2025-11-04 14:49 UTC (permalink / raw)
  To: pdm-devel

Make it already from the tree view apparent which datastores are
removable and which have s3 backend. Fallback to the default if
neither of these is the case or the config could not be parsed.

Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
 ui/src/pbs/tree.rs | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/ui/src/pbs/tree.rs b/ui/src/pbs/tree.rs
index f804665..09d777a 100644
--- a/ui/src/pbs/tree.rs
+++ b/ui/src/pbs/tree.rs
@@ -14,7 +14,7 @@ use pwt::widget::data_table::{DataTable, DataTableColumn, DataTableHeader};
 use pwt::widget::form::Field;
 use pwt::widget::{ActionIcon, Button, Column, Container, Fa, Row, Toolbar, Tooltip, Trigger};
 
-use pbs_api_types::DataStoreConfig;
+use pbs_api_types::{DataStoreConfig, DatastoreBackendType};
 
 use crate::get_deep_url;
 use crate::renderer::render_tree_column;
@@ -290,10 +290,22 @@ fn columns(
                     Container::new().with_child(Fa::new("server")),
                     remote_name.clone(),
                 ),
-                PbsTreeNode::Datastore(datastore) => (
-                    Container::new().with_child(Fa::new("database")),
-                    datastore.name.clone(),
-                ),
+                PbsTreeNode::Datastore(datastore) => {
+                    let backend_config = datastore.parse_backend_config().unwrap_or_default();
+                    let backend_s3 = match backend_config.ty.unwrap_or_default() {
+                        DatastoreBackendType::Filesystem => false,
+                        DatastoreBackendType::S3 => true,
+                    };
+                    let icon = if datastore.backing_device.is_some() {
+                        Fa::new("plug")
+                    } else if backend_s3 {
+                        Fa::new("cloud-upload")
+                    } else {
+                        Fa::new("database")
+                    };
+
+                    (Container::new().with_child(icon), datastore.name.clone())
+                }
             };
             render_tree_column(icon.into(), text).into()
         })
-- 
2.47.3



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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview
  2025-11-04 14:49 [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview Christian Ebner
                   ` (3 preceding siblings ...)
  2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox-datacenter-manager 3/3] ui: datastore tree: indicate datastore type by different icons Christian Ebner
@ 2025-11-05 16:00 ` Shan Shaji
  2025-11-05 16:26   ` Shan Shaji
  4 siblings, 1 reply; 7+ messages in thread
From: Shan Shaji @ 2025-11-05 16:00 UTC (permalink / raw)
  To: Proxmox Datacenter Manager development discussion; +Cc: pdm-devel

Applied this patch series and verified the following:

- Added a backup server to PDM.
- Added local, removable, and S3 datastores(cloudflare r2) 
  to the backup server.
- Verified that the icons are displayed correctly 
  in both the tree view and the overview section.
- Confirmed that the icons differ based on the datastore type.
- For the S3 datastore, the endpoint ID is visible in 
  the overview section, and for the removable device, the 
  UUID is shown.

Tested-by: Shan Shaji <s.shaji@proxmox.com>


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview
  2025-11-05 16:00 ` [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview Shan Shaji
@ 2025-11-05 16:26   ` Shan Shaji
  0 siblings, 0 replies; 7+ messages in thread
From: Shan Shaji @ 2025-11-05 16:26 UTC (permalink / raw)
  To: Shan Shaji, Proxmox Datacenter Manager development discussion; +Cc: pdm-devel

I have gone through the code and the changes looks fine. However, it
would be good to have another review as well.  

Reviewed-by: Shan Shaji <s.shaji@proxmox.com>

On Wed Nov 5, 2025 at 5:00 PM CET, Shan Shaji wrote:
> Applied this patch series and verified the following:
>
> - Added a backup server to PDM.
> - Added local, removable, and S3 datastores(cloudflare r2) 
>   to the backup server.
> - Verified that the icons are displayed correctly 
>   in both the tree view and the overview section.
> - Confirmed that the icons differ based on the datastore type.
> - For the S3 datastore, the endpoint ID is visible in 
>   the overview section, and for the removable device, the 
>   UUID is shown.
>
> Tested-by: Shan Shaji <s.shaji@proxmox.com>



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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-11-05 16:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-04 14:49 [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview Christian Ebner
2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox 1/1] pbs-api-types: extend datastore config by backend config parser helper Christian Ebner
2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox-datacenter-manager 1/3] ui: indicate removable datastore in overview and show backing device Christian Ebner
2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox-datacenter-manager 2/3] ui: indicate s3 datastores in overview and show endpoint id Christian Ebner
2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox-datacenter-manager 3/3] ui: datastore tree: indicate datastore type by different icons Christian Ebner
2025-11-05 16:00 ` [pdm-devel] [PATCH proxmox{, -datacenter-manager} 0/4] show dedicated datastore icons in tree view and removable/s3 backend info in overview Shan Shaji
2025-11-05 16:26   ` Shan Shaji

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