From: Christian Ebner <c.ebner@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox-datacenter-manager 3/3] ui: datastore tree: indicate datastore type by different icons
Date: Tue, 4 Nov 2025 15:49:05 +0100 [thread overview]
Message-ID: <20251104144905.582920-5-c.ebner@proxmox.com> (raw)
In-Reply-To: <20251104144905.582920-1-c.ebner@proxmox.com>
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
prev parent reply other threads:[~2025-11-04 14:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Christian Ebner [this message]
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=20251104144905.582920-5-c.ebner@proxmox.com \
--to=c.ebner@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.