From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 4662D1FF0B7 for ; Mon, 30 Nov 2026 10:45:09 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BC0F32170B; Mon, 30 Nov 2026 10:45:05 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Subject: [PATCH datacenter-manager 2/2] ui: remote updates: reload the details of a node in place Date: Mon, 30 Nov 2026 10:44:55 +0100 Message-ID: <20261130094500.972447-3-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261130094500.972447-1-d.csapak@proxmox.com> References: <20261130094500.972447-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.250 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: CJXVRPY7AXTSKOV67HAX2KTJTAKKRUNO X-Message-ID-Hash: CJXVRPY7AXTSKOV67HAX2KTJTAKKRUNO X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: instead of recreating the components, which left the panel empty until they finished loading. They were recreated whenever the 'last_refresh' of the node's summary changed. Since loading the list of updates refreshes the summary of that node too, this happened after every reload of the summary, so every 5 seconds. Now we only recreate them when another node is selected, and use the new 'reload_generation' property to reload them after each load of the summary. If they are still loading at that point (e.g. for a slow remote), that reload is skipped. Signed-off-by: Dominik Csapak --- ui/src/remotes/updates.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ui/src/remotes/updates.rs b/ui/src/remotes/updates.rs index b4aa2db2..3b11b1a3 100644 --- a/ui/src/remotes/updates.rs +++ b/ui/src/remotes/updates.rs @@ -232,6 +232,8 @@ struct UpdateTreeComponent { selection: Selection, selected_key: Option, refreshing: bool, + // changing it makes the widgets of the selected node load again + reload_generation: u64, acl_context: AclContext, _acl_context_handle: ContextHandle, _remote_list_handle: Option>, @@ -444,6 +446,7 @@ impl LoadableComponent for UpdateTreeComponent { selection, selected_key: None, refreshing: false, + reload_generation: 0, acl_context, _acl_context_handle, _remote_list_handle, @@ -492,6 +495,7 @@ impl LoadableComponent for UpdateTreeComponent { let data = build_store_from_response(updates); self.store.write().update_root_tree(data); self.store.set_sorter(default_sorter); + self.reload_generation += 1; return true; } @@ -649,6 +653,7 @@ impl UpdateTreeComponent { .enable_upgrade(true) .show_update_changelogs(true) .subscription_url(subscription_url.clone()) + .reload_generation(self.reload_generation) .on_upgrade({ let link = ctx.link().clone(); let remote = remote.clone(); @@ -681,15 +686,15 @@ impl UpdateTreeComponent { .product(product) .status_only(true) .subscription_url(subscription_url) + .reload_generation(self.reload_generation) .base_url(base_url.clone()), ); let packages = render_update_list(&self.acl_context, remote, node, || apt.into()); - // Both widgets load only once for their URL, so recreate them whenever the - // node's update summary was refreshed. + // start over for another node, instead of showing the previous one until it loaded Column::new() - .key(format!("{remote}/{node}/{}", summary.last_refresh)) + .key(format!("{remote}/{node}")) .class(FlexFit) .with_child(repo_status) .with_child(html! {