Bug #14261
closedTrim white space in a DHCP Leases page search field
100%
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
Updated by Jim Pingle over 1 year ago
- Category changed from Web Interface to DHCP (IPv4)
Updated by Christopher Cope over 1 year ago
- Status changed from New to Pull Request Review
Updated by Jim Pingle over 1 year ago
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 by Christopher Cope about 1 year ago
Updated merge request to reflect feedback and to only trim on values where a space doesn't make sense.
Updated by Christian McDonald about 1 year ago
- Status changed from Pull Request Review to Feedback
- Assignee set to Christian McDonald
Updated by Christian McDonald about 1 year ago
- Assignee changed from Christian McDonald to Christopher Cope
Updated by Christopher Cope about 1 year ago
- % Done changed from 0 to 100
Applied in changeset 8c2615a322f4c7ae04d97efb16159904b0503160.
Updated by Christopher Cope 8 months ago
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.
Updated by Danilo Zrenjanin 8 months ago
- 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.