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 9B42C1FF165 for ; Thu, 28 Aug 2025 16:19:18 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E2A3511EFC; Thu, 28 Aug 2025 16:19:27 +0200 (CEST) Message-ID: <05c340c0-4f74-4009-b792-0d693b961c4a@proxmox.com> Date: Thu, 28 Aug 2025 16:18:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Proxmox Datacenter Manager development discussion , Shannon Sterz References: <20250828131832.4058422-1-d.csapak@proxmox.com> <20250828131832.4058422-4-d.csapak@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1756390727518 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.022 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 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 Cc: pdm-devel Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" On 8/28/25 3:53 PM, Shannon Sterz wrote: >> +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. ah yes, i overlooked that check imho it should be None => remote_name.contains(&term.value) || "remote".starts_with(&term_value), Can send as a follow up or if something else comes i'll include that in a v5 > > [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 > > _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel