Bug #14261
closed
Trim white space in a DHCP Leases page search field
Added by Sergei Shablovsky over 1 year ago.
Updated 7 months ago.
Description
Hi!
On DHCP Leases status page, in Search section, in Search term field BEFORE displaying results in Leases table below SEARCH INPUT TEXT NEED TO BE trim AT START and AT END to avoid wrong results (nothing) to be displayed:
EXAMPLE:
1.
“ 192.168.70.25” need to be trim to “192.168.70.25”
2.
“192.168.70.25 “ need to be trim to “102.168.70.25”
3.
“active “ need to be trim to “active”
Files
- Category changed from Web Interface to DHCP (IPv4)
- Status changed from New to Pull Request Review
I'm not sure I agree this is a problem exactly as stated. Sometimes I may want to search for a specific string that starts or ends with a space, and since the search matches the Description field from static mappings (which can contain spaces), it's useful to keep that behavior.
What would be valid is more logic where this trim ONLY gets applied if the user has selected to search a specific field in which spaces are not valid. Such as "IP Address", "MAC Address", or "Hostname".
Updated merge request to reflect feedback and to only trim on values where a space doesn't make sense.
- Status changed from Pull Request Review to Feedback
- Assignee set to Christian McDonald
- Assignee changed from Christian McDonald to Christopher Cope
- % Done changed from 0 to 100
this seems to work as described with the dhcp lease search as tested on 24.03.b.20240405.1653, adding a leading or trailing space to a partial IP address does not return different results than without.
on 24.03.r.20240410.1729 adding a leading/trailing space to a search term returns no results
same behavior as above using 24.03.r.20240416.0005, adding a space on either side removes any results when searching
Tested on
24.03-RELEASE (amd64)
built on Thu Apr 18 19:54:00 EDT 2024
FreeBSD 15.0-CURRENT
and it's working as expected.
As noted in the discussion above, this only applies to searches for values that should never have spaces in them, such as when searching by IP Address, MAC Address, etc. It will not trim all searches.
- Status changed from Feedback to Closed
I can confirm it's working as Jim recommended.
Trim is applied only when the "IP Address," "MAC Address," or "Hostname" search categories are selected.
Tested against:
24.03-RELEASE (arm)
built on Fri Apr 19 1:54:00 CEST 2024
FreeBSD 15.0-CURRENT
I am closing this ticket as resolved.
Also available in: Atom
PDF