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 512501FF183 for ; Wed, 3 Dec 2025 12:08:00 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 52E4A780B; Wed, 3 Dec 2025 12:08:26 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Wed, 3 Dec 2025 12:07:49 +0100 Message-ID: <20251203110753.2056456-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.030 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 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [self.data] Subject: [pdm-devel] [PATCH datacenter-manager] ui: subscription panel: add loading indicator for first load 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" at that time, the panel is empty and the rotating refresh icon is not always very noticeable, so add a loading indicator for the first load. Signed-off-by: Dominik Csapak --- ui/src/configuration/subscription_panel.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ui/src/configuration/subscription_panel.rs b/ui/src/configuration/subscription_panel.rs index 10111329..b094836c 100644 --- a/ui/src/configuration/subscription_panel.rs +++ b/ui/src/configuration/subscription_panel.rs @@ -7,8 +7,9 @@ use serde_json::Value; use yew::virtual_dom::{VComp, VNode}; +use pwt::css; use pwt::prelude::*; -use pwt::widget::{error_message, Button, Column, Container, Row, Toolbar}; +use pwt::widget::{error_message, Button, Column, Container, Progress, Row, Toolbar}; use proxmox_yew_comp::{http_get, http_post, KVGrid, KVGridRow}; use proxmox_yew_comp::{LoadableComponent, LoadableComponentContext, LoadableComponentMaster}; @@ -31,6 +32,7 @@ pub enum Msg { pub struct ProxmoxSubscriptionPanel { rows: Rc>, data: Option>, + loaded: bool, } impl LoadableComponent for ProxmoxSubscriptionPanel { @@ -42,6 +44,7 @@ impl LoadableComponent for ProxmoxSubscriptionPanel { Self { rows: Rc::new(rows()), data: None, + loaded: false, } } @@ -49,6 +52,7 @@ impl LoadableComponent for ProxmoxSubscriptionPanel { match msg { Msg::LoadFinished(value) => { self.data = Some(Rc::new(value)); + self.loaded = true; } } true @@ -108,10 +112,15 @@ impl LoadableComponent for ProxmoxSubscriptionPanel { None => Rc::new(Value::Null), }; - KVGrid::new() - .class("pwt-flex-fit") - .data(data.clone()) - .rows(Rc::clone(&self.rows)) + Column::new() + .class(css::FlexFit) + .with_optional_child((!self.loaded).then_some(Progress::new())) + .with_child( + KVGrid::new() + .class(css::FlexFit) + .data(data.clone()) + .rows(Rc::clone(&self.rows)), + ) .into() } } -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel