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 A93EB1FF165 for ; Thu, 28 Aug 2025 15:53:46 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E214A116E4; Thu, 28 Aug 2025 15:53:55 +0200 (CEST) Mime-Version: 1.0 Date: Thu, 28 Aug 2025 15:53:22 +0200 Message-Id: Cc: "pdm-devel" To: "Proxmox Datacenter Manager development discussion" X-Mailer: aerc 0.20.0 References: <20250828131832.4058422-1-d.csapak@proxmox.com> <20250828131832.4058422-4-d.csapak@proxmox.com> In-Reply-To: <20250828131832.4058422-4-d.csapak@proxmox.com> From: "Shannon Sterz" X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1756389195616 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.025 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_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pdm-devel] [PATCH datacenter-manager v4 03/10] server: api: resources: add more complex filter syntax 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" > +fn remote_matches_search_term(remote_name: &str, online: Option, term: &SearchTerm) -> bool { > + match term.category.as_deref() { > + Some("remote" | "name" | "id") => remote_name.contains(&term.value), > + Some("type") => "remote".starts_with(&term.value), > + Some("status") => match online { > + None => true, > + Some(true) => "online".starts_with(&term.value), > + Some(false) => "offline".starts_with(&term.value), > + }, > + None => remote_name.contains(&term.value) || "remote".contains(&term.value), correct me if im wrong, but wouldn't this mean that any search without a category would return all remotes given that the term's value is a substring of "remote"? so if i type "e" i'd get all remotes? since this has already been a concern for searches with a `type` category [1] in v3, maybe this here should also be a `starts_with` match? seems more consistent to me anyway. [1]: https://lore.proxmox.com/pdm-devel/f992b565-f7e3-4339-80ce-aabd49cef773@proxmox.com/T/#m74b8924dda5ddb32aeee34a6685fa4a769380ef9 -->8 snip 8<-- _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel