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 F14671FF17C for ; Wed, 3 Sep 2025 13:41:26 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id F3716ABB8; Wed, 3 Sep 2025 13:41:40 +0200 (CEST) From: Lukas Wagner To: pdm-devel@lists.proxmox.com Date: Wed, 3 Sep 2025 13:41:18 +0200 Message-ID: <20250903114123.215787-3-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: 1756899682883 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 2/2] apt view: reload if base urls have changed 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" If we use this view to show available node updates, we might want to change the node afterwards (e.g. by selecting another node in a tree). By implementing the `changed` function we can trigger a reload if the relevant props change. Signed-off-by: Lukas Wagner Tested-by: Stefan Hanreich Reviewed-by: Stefan Hanreich --- src/apt_package_manager.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/apt_package_manager.rs b/src/apt_package_manager.rs index 6cd179f..3b871f7 100644 --- a/src/apt_package_manager.rs +++ b/src/apt_package_manager.rs @@ -256,6 +256,21 @@ impl LoadableComponent for ProxmoxAptPackageManager { } } } + + fn changed( + &mut self, + ctx: &LoadableComponentContext, + old_props: &Self::Properties, + ) -> bool { + let props = ctx.props(); + + if props.base_url != old_props.base_url || props.task_base_url != old_props.task_base_url { + ctx.link().send_reload(); + true + } else { + false + } + } } impl From for VNode { -- 2.47.2 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel