all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH datacenter-manager] ui: subscription panel: add loading indicator for first load
@ 2025-12-03 11:07 Dominik Csapak
  2025-12-03 12:13 ` [pdm-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2025-12-03 11:07 UTC (permalink / raw)
  To: 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 <d.csapak@proxmox.com>
---
 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<Vec<KVGridRow>>,
     data: Option<Rc<Value>>,
+    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


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

* [pdm-devel] applied: [PATCH datacenter-manager] ui: subscription panel: add loading indicator for first load
  2025-12-03 11:07 [pdm-devel] [PATCH datacenter-manager] ui: subscription panel: add loading indicator for first load Dominik Csapak
@ 2025-12-03 12:13 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-12-03 12:13 UTC (permalink / raw)
  To: pdm-devel, Dominik Csapak

On Wed, 03 Dec 2025 12:07:49 +0100, Dominik Csapak wrote:
> 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.
> 
> 

Applied, thanks!

[1/1] ui: subscription panel: add loading indicator for first load
      commit: a2b1c969724e92fa9738e48463c4769ad42e7246


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


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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-03 11:07 [pdm-devel] [PATCH datacenter-manager] ui: subscription panel: add loading indicator for first load Dominik Csapak
2025-12-03 12:13 ` [pdm-devel] applied: " Thomas Lamprecht

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