all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager] ui: subscription panel: add loading indicator for first load
Date: Wed,  3 Dec 2025 12:07:49 +0100	[thread overview]
Message-ID: <20251203110753.2056456-1-d.csapak@proxmox.com> (raw)

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


             reply	other threads:[~2025-12-03 11:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-03 11:07 Dominik Csapak [this message]
2025-12-03 12:13 ` [pdm-devel] applied: " Thomas Lamprecht

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=20251203110753.2056456-1-d.csapak@proxmox.com \
    --to=d.csapak@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 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