all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH datacenter-manager] ui: datastore panel: disable content tab when datastore is offline
@ 2025-12-16 12:12 Shannon Sterz
  2025-12-16 13:55 ` Shannon Sterz
  2025-12-16 14:40 ` [pdm-devel] Superseded: " Shannon Sterz
  0 siblings, 2 replies; 3+ messages in thread
From: Shannon Sterz @ 2025-12-16 12:12 UTC (permalink / raw)
  To: pdm-devel

and show a tooltip explaining why.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
 ui/src/pbs/datastore.rs | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/ui/src/pbs/datastore.rs b/ui/src/pbs/datastore.rs
index 274c6ef..9a21caa 100644
--- a/ui/src/pbs/datastore.rs
+++ b/ui/src/pbs/datastore.rs
@@ -5,7 +5,10 @@ use yew::{
     Component, Properties,
 };
 
-use pwt::{css::FlexFit, props::WidgetBuilder, tr, widget::TabBarItem};
+use pwt::css::FlexFit;
+use pwt::props::WidgetBuilder;
+use pwt::tr;
+use pwt::widget::{TabBarItem, Tooltip};
 
 use pbs_api_types::DataStoreConfig;
 
@@ -45,6 +48,13 @@ impl Component for DatastorePanelComp {
 
     fn view(&self, ctx: &yew::Context<Self>) -> yew::Html {
         let props = ctx.props();
+        let offline = props
+            .config
+            .maintenance_mode
+            .as_ref()
+            .map(|v| v == "offline")
+            .unwrap_or_default();
+
         pwt::widget::TabPanel::new()
             .router(true)
             .class(FlexFit)
@@ -64,6 +74,14 @@ impl Component for DatastorePanelComp {
                 TabBarItem::new()
                     .key("content")
                     .label(tr!("Content"))
+                    .disabled(offline)
+                    .tip(
+                        offline.then_some(
+                            Tooltip::new(tr!(
+                        "Only available if the datastore is not in maintenance mode \"offline\"."))
+                            .into(),
+                        ),
+                    )
                     .icon_class("fa fa-th"),
                 {
                     let remote = props.remote.clone();
-- 
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] 3+ messages in thread

* Re: [pdm-devel] [PATCH datacenter-manager] ui: datastore panel: disable content tab when datastore is offline
  2025-12-16 12:12 [pdm-devel] [PATCH datacenter-manager] ui: datastore panel: disable content tab when datastore is offline Shannon Sterz
@ 2025-12-16 13:55 ` Shannon Sterz
  2025-12-16 14:40 ` [pdm-devel] Superseded: " Shannon Sterz
  1 sibling, 0 replies; 3+ messages in thread
From: Shannon Sterz @ 2025-12-16 13:55 UTC (permalink / raw)
  To: Shannon Sterz; +Cc: pdm-devel

On Tue Dec 16, 2025 at 1:12 PM CET, Shannon Sterz wrote:
> and show a tooltip explaining why.
>
> Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
> ---
>  ui/src/pbs/datastore.rs | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/ui/src/pbs/datastore.rs b/ui/src/pbs/datastore.rs
> index 274c6ef..9a21caa 100644
> --- a/ui/src/pbs/datastore.rs
> +++ b/ui/src/pbs/datastore.rs
> @@ -5,7 +5,10 @@ use yew::{
>      Component, Properties,
>  };
>
> -use pwt::{css::FlexFit, props::WidgetBuilder, tr, widget::TabBarItem};
> +use pwt::css::FlexFit;
> +use pwt::props::WidgetBuilder;
> +use pwt::tr;
> +use pwt::widget::{TabBarItem, Tooltip};
>
>  use pbs_api_types::DataStoreConfig;
>
> @@ -45,6 +48,13 @@ impl Component for DatastorePanelComp {
>
>      fn view(&self, ctx: &yew::Context<Self>) -> yew::Html {
>          let props = ctx.props();
> +        let offline = props
> +            .config
> +            .maintenance_mode
> +            .as_ref()
> +            .map(|v| v == "offline")
> +            .unwrap_or_default();
> +
>          pwt::widget::TabPanel::new()
>              .router(true)
>              .class(FlexFit)
> @@ -64,6 +74,14 @@ impl Component for DatastorePanelComp {
>                  TabBarItem::new()
>                      .key("content")
>                      .label(tr!("Content"))
> +                    .disabled(offline)
> +                    .tip(
> +                        offline.then_some(
> +                            Tooltip::new(tr!(
> +                        "Only available if the datastore is not in maintenance mode \"offline\"."))
> +                            .into(),
> +                        ),
> +                    )
>                      .icon_class("fa fa-th"),
>                  {
>                      let remote = props.remote.clone();

this doesn't quite work as intended. i'll send a v2 soon, disregard this
for now.


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


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

* [pdm-devel] Superseded: Re: [PATCH datacenter-manager] ui: datastore panel: disable content tab when datastore is offline
  2025-12-16 12:12 [pdm-devel] [PATCH datacenter-manager] ui: datastore panel: disable content tab when datastore is offline Shannon Sterz
  2025-12-16 13:55 ` Shannon Sterz
@ 2025-12-16 14:40 ` Shannon Sterz
  1 sibling, 0 replies; 3+ messages in thread
From: Shannon Sterz @ 2025-12-16 14:40 UTC (permalink / raw)
  To: Shannon Sterz; +Cc: pdm-devel

Superseded-by: https://lore.proxmox.com/pdm-devel/20251216143856.302676-2-s.sterz@proxmox.com/T/#u

On Tue Dec 16, 2025 at 1:12 PM CET, Shannon Sterz wrote:
> and show a tooltip explaining why.
>
> Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
> ---
>  ui/src/pbs/datastore.rs | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)
>
> diff --git a/ui/src/pbs/datastore.rs b/ui/src/pbs/datastore.rs
> index 274c6ef..9a21caa 100644
> --- a/ui/src/pbs/datastore.rs
> +++ b/ui/src/pbs/datastore.rs
> @@ -5,7 +5,10 @@ use yew::{
>      Component, Properties,
>  };
>
> -use pwt::{css::FlexFit, props::WidgetBuilder, tr, widget::TabBarItem};
> +use pwt::css::FlexFit;
> +use pwt::props::WidgetBuilder;
> +use pwt::tr;
> +use pwt::widget::{TabBarItem, Tooltip};
>
>  use pbs_api_types::DataStoreConfig;
>
> @@ -45,6 +48,13 @@ impl Component for DatastorePanelComp {
>
>      fn view(&self, ctx: &yew::Context<Self>) -> yew::Html {
>          let props = ctx.props();
> +        let offline = props
> +            .config
> +            .maintenance_mode
> +            .as_ref()
> +            .map(|v| v == "offline")
> +            .unwrap_or_default();
> +
>          pwt::widget::TabPanel::new()
>              .router(true)
>              .class(FlexFit)
> @@ -64,6 +74,14 @@ impl Component for DatastorePanelComp {
>                  TabBarItem::new()
>                      .key("content")
>                      .label(tr!("Content"))
> +                    .disabled(offline)
> +                    .tip(
> +                        offline.then_some(
> +                            Tooltip::new(tr!(
> +                        "Only available if the datastore is not in maintenance mode \"offline\"."))
> +                            .into(),
> +                        ),
> +                    )
>                      .icon_class("fa fa-th"),
>                  {
>                      let remote = props.remote.clone();



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


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

end of thread, other threads:[~2025-12-16 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-16 12:12 [pdm-devel] [PATCH datacenter-manager] ui: datastore panel: disable content tab when datastore is offline Shannon Sterz
2025-12-16 13:55 ` Shannon Sterz
2025-12-16 14:40 ` [pdm-devel] Superseded: " Shannon Sterz

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