[pdm-devel] [PATCH datacenter-manager v3 3/9] server: api: resources: add more complex filter syntax

Stefan Hanreich s.hanreich at proxmox.com
Wed Aug 27 11:33:31 CEST 2025


On 8/27/25 11:16 AM, Lukas Wagner wrote:

[snip]

>> +fn remote_matches_search_term(remote_name: &str, online: Option<bool>, term: &SearchTerm) -> bool {
>> +    match term.category.as_deref() {
>> +        Some("remote" | "name" | "id") => remote_name.contains(&term.value),
>> +        Some("type") => "remote".contains(&term.value),
> 
> This is IMO a bit odd, since this would allow you to write something
> like
>    
>    type:e
> 
> and still get type:remote matches, since e is contained in 'remote'.
> 
> I think for some of these I would only allow a full match, 'type' and
> 'status' comes to mind at a quick glance (for status online, on,
> offline, off) could be allowed values)
> 

maybe a prefix match is a good compromise? that way one can start typing
'type:remo' and get the results early without having to type out the
full status / type /...

[snip]




More information about the pdm-devel mailing list