From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id DF27E1FF183 for ; Wed, 10 Sep 2025 13:53:04 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id A04981FA50; Wed, 10 Sep 2025 13:53:07 +0200 (CEST) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Wed, 10 Sep 2025 13:52:49 +0200 Message-ID: <20250910115259.3530107-2-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250910115259.3530107-1-d.csapak@proxmox.com> References: <20250910115259.3530107-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -2.474 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_DBL_SPAM 5 Contains a spam URL listed in the Spamhaus DBL blocklist [tasks.rs] Subject: [pdm-devel] [PATCH yew-comp 1/1] tasks: add optional fixed filter 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" sometimes it's useful to have a simple fixed filter defined, e.g. when we want to filter for a specific remote. Signed-off-by: Dominik Csapak --- src/tasks.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tasks.rs b/src/tasks.rs index b614dce..6f2a0a0 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -47,6 +47,13 @@ pub struct Tasks { #[prop_or_default] pub extra_filter: Option<(AttrValue, Html)>, + /// Additional fixed filter that cannot be changed or cleared + /// + /// this can be useful when filtering for e.g. node/remote/etc. + #[prop_or_default] + #[builder(IntoPropValue, into_prop_value)] + pub fixed_filter: Option<(String, String)>, + /// The base url, default is `/nodes//tasks`. #[prop_or_default] #[builder(IntoPropValue, into_prop_value)] @@ -247,6 +254,11 @@ impl LoadableComponent for ProxmoxTasks { filter["limit"] = BATCH_LIMIT.into(); + // add fixed filter + if let Some((key, value)) = props.fixed_filter.clone() { + filter[key] = value.into(); + } + let link = ctx.link().clone(); Box::pin(async move { let mut data: Vec<_> = crate::http_get(&path, Some(filter)).await?; -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel