public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH datacenter-manager/proxmox-yew-comp 0/2] ui: remote updates: reload the details of a node in place
@ 2026-11-30  9:44 Dominik Csapak
  2026-11-30  9:44 ` [PATCH proxmox-yew-comp 1/2] apt package manager/repositories: add 'reload_generation' property Dominik Csapak
  2026-11-30  9:44 ` [PATCH datacenter-manager 2/2] ui: remote updates: reload the details of a node in place Dominik Csapak
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-11-30  9:44 UTC (permalink / raw)
  To: pdm-devel

In the remote updates panel, the details of the selected node (the
repository status and the list of updates) were empty for a moment every
5 seconds.

Both components 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, that was the case after every reload of the summary.

The proxmox-yew-comp patch adds a 'reload_generation' property to the
apt package manager and the apt repositories component, which lets them
load their data again while keeping the old content until the new one
arrives. A change of the property is ignored while a load is still
ongoing, so that the loads don't pile up.

The proxmox-datacenter-manager patch uses that to reload them after each
load of the summary, and only recreates them when another node is
selected. It needs the proxmox-yew-comp patch for the new property.

For users that can list the updates of the node, this does not increase
how often the remote is queried, since the components were recreated
(and thus loaded their data) just as often before. For a slow remote it
is less often now, as a reload is skipped while the previous one is
still ongoing.


proxmox-yew-comp:

Dominik Csapak (1):
  apt package manager/repositories: add 'reload_generation' property

 src/apt_package_manager.rs | 11 ++++++++++-
 src/apt_repositories.rs    |  7 +++++++
 2 files changed, 17 insertions(+), 1 deletion(-)


proxmox-datacenter-manager:

Dominik Csapak (1):
  ui: remote updates: reload the details of a node in place

 ui/src/remotes/updates.rs | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)


Summary over all repositories:
  3 files changed, 25 insertions(+), 4 deletions(-)

-- 
Generated by murpp 0.11.0




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

* [PATCH proxmox-yew-comp 1/2] apt package manager/repositories: add 'reload_generation' property
  2026-11-30  9:44 [PATCH datacenter-manager/proxmox-yew-comp 0/2] ui: remote updates: reload the details of a node in place Dominik Csapak
@ 2026-11-30  9:44 ` Dominik Csapak
  2026-11-30  9:44 ` [PATCH datacenter-manager 2/2] ui: remote updates: reload the details of a node in place Dominik Csapak
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-11-30  9:44 UTC (permalink / raw)
  To: pdm-devel

so that users of these components can let them load their data again,
e.g. when they know that it changed, without having to recreate them.

Recreating shows an empty component until the data is loaded, while a
reload keeps the old content until then, like the reload button of the
package manager does.

A change is ignored while a load is still ongoing, so that the loads
don't pile up when the value changes faster than the data can be
loaded.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/apt_package_manager.rs | 11 ++++++++++-
 src/apt_repositories.rs    |  7 +++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/apt_package_manager.rs b/src/apt_package_manager.rs
index 07454cc..f86ceb1 100644
--- a/src/apt_package_manager.rs
+++ b/src/apt_package_manager.rs
@@ -79,6 +79,12 @@ pub struct AptPackageManager {
     #[builder(IntoPropValue, into_prop_value)]
     /// Custom subscription dialog title and message
     pub subscription_message: Option<(String, Html)>,
+
+    /// Changing this value loads the updates again (if not already running), like the reload
+    /// button of the list does.
+    #[prop_or_default]
+    #[builder]
+    pub reload_generation: u64,
 }
 
 impl Default for AptPackageManager {
@@ -408,7 +414,10 @@ impl LoadableComponent for ProxmoxAptPackageManager {
 
         self.set_task_base_url(props.task_base_url.clone());
 
-        if props.base_url != old_props.base_url || props.task_base_url != old_props.task_base_url {
+        if props.base_url != old_props.base_url
+            || props.task_base_url != old_props.task_base_url
+            || (props.reload_generation != old_props.reload_generation && !self.loading())
+        {
             ctx.link().send_reload();
             true
         } else {
diff --git a/src/apt_repositories.rs b/src/apt_repositories.rs
index 9fd6671..155116e 100644
--- a/src/apt_repositories.rs
+++ b/src/apt_repositories.rs
@@ -61,6 +61,12 @@ pub struct AptRepositories {
     #[builder(IntoPropValue, into_prop_value)]
     #[prop_or_default]
     pub status_only: bool,
+
+    /// Changing this value loads the repositories and the subscription status again (if not
+    /// already running).
+    #[prop_or_default]
+    #[builder]
+    pub reload_generation: u64,
 }
 
 impl Default for AptRepositories {
@@ -552,6 +558,7 @@ impl LoadableComponent for ProxmoxAptRepositories {
         if props.base_url != old_props.base_url
             || props.subscription_url != old_props.subscription_url
             || props.product != old_props.product
+            || (props.reload_generation != old_props.reload_generation && !self.loading())
         {
             ctx.link().send_reload();
             true
-- 
2.47.3





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

* [PATCH datacenter-manager 2/2] ui: remote updates: reload the details of a node in place
  2026-11-30  9:44 [PATCH datacenter-manager/proxmox-yew-comp 0/2] ui: remote updates: reload the details of a node in place Dominik Csapak
  2026-11-30  9:44 ` [PATCH proxmox-yew-comp 1/2] apt package manager/repositories: add 'reload_generation' property Dominik Csapak
@ 2026-11-30  9:44 ` Dominik Csapak
  1 sibling, 0 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-11-30  9:44 UTC (permalink / raw)
  To: pdm-devel

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 <d.csapak@proxmox.com>
---
 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<Key>,
     refreshing: bool,
+    // changing it makes the widgets of the selected node load again
+    reload_generation: u64,
     acl_context: AclContext,
     _acl_context_handle: ContextHandle<AclContext>,
     _remote_list_handle: Option<ContextHandle<crate::RemoteList>>,
@@ -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! {<div role="separator" class="pwt-w-100 pwt-horizontal-rule"/>})
-- 
2.47.3





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

end of thread, other threads:[~2026-11-30  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30  9:44 [PATCH datacenter-manager/proxmox-yew-comp 0/2] ui: remote updates: reload the details of a node in place Dominik Csapak
2026-11-30  9:44 ` [PATCH proxmox-yew-comp 1/2] apt package manager/repositories: add 'reload_generation' property Dominik Csapak
2026-11-30  9:44 ` [PATCH datacenter-manager 2/2] ui: remote updates: reload the details of a node in place Dominik Csapak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal