From: Shannon Sterz <s.sterz@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager v2 1/1] ui: datastore panel: disable content tab when datastore is offline
Date: Tue, 16 Dec 2025 15:38:56 +0100 [thread overview]
Message-ID: <20251216143856.302676-3-s.sterz@proxmox.com> (raw)
In-Reply-To: <20251216143856.302676-1-s.sterz@proxmox.com>
and show a tooltip explaining why.
Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
---
ui/src/pbs/datastore.rs | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/ui/src/pbs/datastore.rs b/ui/src/pbs/datastore.rs
index 274c6ef..878c1b8 100644
--- a/ui/src/pbs/datastore.rs
+++ b/ui/src/pbs/datastore.rs
@@ -45,6 +45,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 +71,15 @@ impl Component for DatastorePanelComp {
TabBarItem::new()
.key("content")
.label(tr!("Content"))
+ .disabled(offline)
+ .tip(
+ offline.then_some(
+ tr!(
+ "Not available if the datastore is 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
next prev parent reply other threads:[~2025-12-16 14:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-16 14:38 [pdm-devel] [PATCH datacenter-manager/yew-widget-toolkit v2 0/2] disable content tab on pbs datastores when they are in maintenance mode "offline" Shannon Sterz
2025-12-16 14:38 ` [pdm-devel] [PATCH yew-widget-toolkit v2 1/1] tab bar: make `TabBarItem::tip` work as intended Shannon Sterz
2025-12-17 13:21 ` [pdm-devel] applied: " Dominik Csapak
2025-12-16 14:38 ` Shannon Sterz [this message]
2025-12-17 13:23 ` [pdm-devel] [PATCH datacenter-manager v2 1/1] ui: datastore panel: disable content tab when datastore is offline Dominik Csapak
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=20251216143856.302676-3-s.sterz@proxmox.com \
--to=s.sterz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox