From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 446311FF165 for ; Thu, 23 Oct 2025 10:33:01 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 910EA38E5; Thu, 23 Oct 2025 10:33:28 +0200 (CEST) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Thu, 23 Oct 2025 10:28:12 +0200 Message-ID: <20251023083253.1038119-9-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251023083253.1038119-1-d.csapak@proxmox.com> References: <20251023083253.1038119-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.028 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pdm-devel] [PATCH datacenter-manager v2 08/16] ui: dashboard: refactor subscription panel creation to its own module X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" so we can more easily reuse it outside the dashboard struct. Signed-off-by: Dominik Csapak --- ui/src/dashboard/mod.rs | 9 ++++- ui/src/dashboard/subscription_info.rs | 54 +++++++++++++-------------- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/ui/src/dashboard/mod.rs b/ui/src/dashboard/mod.rs index c0b20b36..19a09a8c 100644 --- a/ui/src/dashboard/mod.rs +++ b/ui/src/dashboard/mod.rs @@ -34,7 +34,7 @@ mod top_entities; pub use top_entities::TopEntities; mod subscription_info; -pub use subscription_info::SubscriptionInfo; +pub use subscription_info::create_subscription_panel; mod node_panel; pub use node_panel::create_node_panel; @@ -464,7 +464,12 @@ impl Component for PdmDashboard { // ) // }), //) - .with_child(SubscriptionInfo::new()), + .with_child( + create_subscription_panel() + .flex(1.0) + .width(500) + .min_height(150), + ), ) .with_child( Container::new() diff --git a/ui/src/dashboard/subscription_info.rs b/ui/src/dashboard/subscription_info.rs index 08658d10..2a4d94b7 100644 --- a/ui/src/dashboard/subscription_info.rs +++ b/ui/src/dashboard/subscription_info.rs @@ -11,9 +11,7 @@ use proxmox_yew_comp::{http_get, Status}; use pwt::{ css::{AlignItems, FlexFit, JustifyContent, TextAlign}, prelude::tr, - props::{ - ContainerBuilder, CssBorderBuilder, CssPaddingBuilder, WidgetBuilder, WidgetStyleBuilder, - }, + props::{ContainerBuilder, CssBorderBuilder, CssPaddingBuilder, WidgetBuilder}, widget::{Column, Container, Fa, Panel, Row}, AsyncPool, }; @@ -133,31 +131,19 @@ impl Component for PdmSubscriptionInfo { } fn view(&self, _ctx: &yew::Context) -> yew::Html { - let title: Html = Row::new() + Column::new() + .class(FlexFit) + .class(JustifyContent::Center) .class(AlignItems::Center) - .gap(2) - .with_child(Fa::new("ticket")) - .with_child(tr!("Subscription Status")) - .into(); - - Panel::new() - .flex(1.0) - .width(500) - .min_height(150) - .title(title) - .border(true) - .with_child( - Column::new() - .class(FlexFit) - .class(JustifyContent::Center) - .class(AlignItems::Center) - .with_optional_child( - self.loading - .then_some(html! {}), - ) - .with_optional_child( - (!self.loading).then_some(render_subscription_status(&self.status)), - ), + .with_optional_child( + self.loading.then_some( + Container::new() + .padding(4) + .with_child(Container::from_tag("i").class("pwt-loading-icon")), + ), + ) + .with_optional_child( + (!self.loading).then_some(render_subscription_status(&self.status)), ) .into() } @@ -169,3 +155,17 @@ impl From for VNode { VNode::from(comp) } } + +pub fn create_subscription_panel() -> Panel { + let title: Html = Row::new() + .class(AlignItems::Center) + .gap(2) + .with_child(Fa::new("ticket")) + .with_child(tr!("Subscription Status")) + .into(); + + Panel::new() + .title(title) + .border(true) + .with_child(SubscriptionInfo::new()) +} -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel