* [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
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ 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] 5+ 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
2025-11-04 14:49 ` [pdm-devel] [PATCH proxmox-datacenter-manager 3/3] ui: datastore tree: indicate datastore type by different icons Christian Ebner
3 siblings, 0 replies; 5+ 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] 5+ 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
3 siblings, 0 replies; 5+ 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] 5+ 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
3 siblings, 0 replies; 5+ 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] 5+ messages in thread