[pdm-devel] [PATCH proxmox-yew-comp 1/2] apt view: allow to set task_base_url
Lukas Wagner
l.wagner at proxmox.com
Tue Sep 2 17:14:22 CEST 2025
This one is used to poll the 'apt update' task progress. If we want to
use this component for *remote* nodes, we need to be able to set a
custom base url for the task API.
Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
src/apt_package_manager.rs | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/apt_package_manager.rs b/src/apt_package_manager.rs
index 282caa9..6cd179f 100644
--- a/src/apt_package_manager.rs
+++ b/src/apt_package_manager.rs
@@ -40,6 +40,11 @@ pub struct AptPackageManager {
/// The base url for
pub base_url: AttrValue,
+ #[prop_or("/nodes/localhost/tasks".into())]
+ #[builder(IntoPropValue, into_prop_value)]
+ /// The base url for tasks
+ pub task_base_url: AttrValue,
+
/// Enable the upgrade button
#[prop_or_default]
#[builder]
@@ -193,6 +198,9 @@ impl LoadableComponent for ProxmoxAptPackageManager {
.class("pwt-border-bottom")
.with_child(Button::new(tr!("Refresh")).onclick({
let link = ctx.link();
+
+ link.task_base_url(props.task_base_url.clone());
+
let command = format!("{}/update", props.base_url);
move |_| link.start_task(&command, None, false)
}))
--
2.47.2
More information about the pdm-devel
mailing list