[pdm-devel] [PATCH datacenter-manager 4/4] ui: dashboard: subscriptions details: add a 'force refresh' button
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Nov 27 22:10:27 CET 2025
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
>> }
More information about the pdm-devel
mailing list