From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 052AA1FF17C for ; Wed, 3 Sep 2025 13:41:56 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1A87BACA6; Wed, 3 Sep 2025 13:42:11 +0200 (CEST) From: Lukas Wagner To: pdm-devel@lists.proxmox.com Date: Wed, 3 Sep 2025 13:41:17 +0200 Message-ID: <20250903114123.215787-2-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250903114123.215787-1-l.wagner@proxmox.com> References: <20250903114123.215787-1-l.wagner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1756899682794 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.027 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pdm-devel] [PATCH proxmox-yew-comp v2 1/2] apt view: allow to set task_base_url X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" 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 Tested-by: Stefan Hanreich Reviewed-by: Stefan Hanreich --- 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 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel