From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH yew-comp 1/1] tasks: add optional fixed filter
Date: Wed, 10 Sep 2025 13:52:49 +0200 [thread overview]
Message-ID: <20250910115259.3530107-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250910115259.3530107-1-d.csapak@proxmox.com>
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 <d.csapak@proxmox.com>
---
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/<nodename>/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
next prev parent reply other threads:[~2025-09-10 11:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 11:52 [pdm-devel] [PATCH datacenter-manager/yew-comp 0/6] ui: add remote task panel and filtering Dominik Csapak
2025-09-10 11:52 ` Dominik Csapak [this message]
2025-09-10 12:23 ` [pdm-devel] applied: [PATCH yew-comp 1/1] tasks: add optional fixed filter Thomas Lamprecht
2025-09-10 11:52 ` [pdm-devel] [PATCH datacenter-manager 1/5] ui: adapt to new node_ref semantic for new pwt Dominik Csapak
2025-09-10 13:50 ` [pdm-devel] applied: " Thomas Lamprecht
2025-09-10 11:52 ` [pdm-devel] [PATCH datacenter-manager 2/5] ui: remote: tasks: add remote filter Dominik Csapak
2025-09-10 13:50 ` [pdm-devel] applied: " Thomas Lamprecht
2025-09-10 11:52 ` [pdm-devel] [PATCH datacenter-manager 3/5] ui: remote: tasks: add optional remote property to filter Dominik Csapak
2025-09-10 13:50 ` [pdm-devel] applied: " Thomas Lamprecht
2025-09-10 11:52 ` [pdm-devel] [PATCH datacenter-manager 4/5] ui: pve: tree: use correct key for the root node Dominik Csapak
2025-09-10 13:50 ` [pdm-devel] applied: " Thomas Lamprecht
2025-09-10 11:52 ` [pdm-devel] [PATCH datacenter-manager 5/5] ui: pve: tree: add remote tasks panel Dominik Csapak
2025-09-10 13:50 ` [pdm-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250910115259.3530107-2-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox