[pdm-devel] [PATCH proxmox-datacenter-manager 3/3] ui: datastore tree: indicate datastore type by different icons

Christian Ebner c.ebner at proxmox.com
Tue Nov 4 15:49:05 CET 2025


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 at 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





More information about the pdm-devel mailing list