From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: "Proxmox Datacenter Manager development discussion"
<pdm-devel@lists.proxmox.com>,
"Michael Köppl" <m.koeppl@proxmox.com>
Cc: pdm-devel <pdm-devel-bounces@lists.proxmox.com>
Subject: Re: [pdm-devel] [PATCH datacenter-manager 4/4] ui: dashboard: subscriptions details: add a 'force refresh' button
Date: Thu, 27 Nov 2025 22:10:27 +0100 [thread overview]
Message-ID: <5bd56df5-eacf-4e70-b416-5440aac2513c@proxmox.com> (raw)
In-Reply-To: <DEJLYY9YQTTO.ROVZ6G5JFE1K@proxmox.com>
Am 27.11.25 um 17:13 schrieb Michael Köppl:
> 1 nit inline
>
> On Thu Nov 27, 2025 at 3:03 PM CET, Dominik Csapak wrote:
>> pub fn create_subscription_panel(
>> diff --git a/ui/src/dashboard/view.rs b/ui/src/dashboard/view.rs
>> index 2adcee53..2791277b 100644
>> --- a/ui/src/dashboard/view.rs
>> +++ b/ui/src/dashboard/view.rs
>> @@ -95,6 +95,7 @@ pub enum Msg {
>> ShowSubscriptionsDialog(bool),
>> LayoutUpdate(ViewLayout),
>> UpdateResult(Result<(), Error>),
>> + ForceSubscriptionUpdate,
>> }
>>
>> struct ViewComp {
>> @@ -425,6 +426,22 @@ impl Component for ViewComp {
>> Msg::UpdateResult(res) => {
>> self.update_result.update(res);
>> }
>> + Msg::ForceSubscriptionUpdate => {
>> + let link = ctx.link().clone();
>> + let view = ctx.props().view.clone();
>> + self.render_args.subscriptions.write().clear();
>
> nit: Clearing here means that if fetching the subscriptions takes longer
> for some reason, the user will look at an empty box until the data could
> be fetched. Could it make sense to move clearing this to after the
> request is done by perhaps tracking the loading state in some way?
Agree in general, but...
>
>> + self.async_pool.spawn(async move {
>> + let mut params = json!({
>> + "verbose": true,
>> + "max-age": 0,
>> + });
>> + if let Some(view) = view {
>> + params["view"] = view.to_string().into();
>> + }
>> + let res = http_get("/resources/subscription", Some(params)).await;
>
> here
... the create_subscriptions_dialog uses the existence of data as heuristic to
determine if it should show that the component is loading:
let loading = !subs.read().has_data();
So this needs adaption to still look OK, shouldn't be that hard, but OTOH it's
also not pressing for now IMO.
>
>> + link.send_message(Msg::LoadingResult(LoadingResult::SubscriptionInfo(res)));
>> + });
>> + }
>> }
>> true
>> }
_______________________________________________
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-11-27 21:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-27 14:03 [pdm-devel] [PATCH datacenter-manager 0/4] improve subscription display in Dominik Csapak
2025-11-27 14:03 ` [pdm-devel] [PATCH datacenter-manager 1/4] ui: dashboard: subscriptions: refactor subscriptions show logic Dominik Csapak
2025-11-27 14:03 ` [pdm-devel] [PATCH datacenter-manager 2/4] ui: dashboard: subscriptions list: update store when data changes Dominik Csapak
2025-11-27 14:03 ` [pdm-devel] [PATCH datacenter-manager 3/4] ui: dashboard: subscriptions list: improve display of subscription state Dominik Csapak
2025-11-27 14:03 ` [pdm-devel] [PATCH datacenter-manager 4/4] ui: dashboard: subscriptions details: add a 'force refresh' button Dominik Csapak
2025-11-27 16:13 ` Michael Köppl
2025-11-27 21:10 ` Thomas Lamprecht [this message]
2025-11-27 16:13 ` [pdm-devel] [PATCH datacenter-manager 0/4] improve subscription display in Michael Köppl
2025-11-27 21:12 ` [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=5bd56df5-eacf-4e70-b416-5440aac2513c@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=m.koeppl@proxmox.com \
--cc=pdm-devel-bounces@lists.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