Project

General

Profile

Actions

Bug #14261

closed

Trim white space in a DHCP Leases page search field

Added by Sergei Shablovsky about 1 year ago. Updated 25 days ago.

Status:
Closed
Priority:
Low
Category:
DHCP (IPv4)
Target version:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Default
Affected Version:
All
Affected Architecture:

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

67B6B936-5A25-4734-81ED-ABA9F2AA2C30.jpeg (68 KB) 67B6B936-5A25-4734-81ED-ABA9F2AA2C30.jpeg “ 192.168.70.25” need to be trim to “192.168.70.25” Sergei Shablovsky, 04/10/2023 01:44 AM
489ACCE2-67E1-4A3C-8732-843BFD4827CB.jpeg (71 KB) 489ACCE2-67E1-4A3C-8732-843BFD4827CB.jpeg “192.168.70.25 “ need to be trim to “102.168.70.25” Sergei Shablovsky, 04/10/2023 01:44 AM
B632AAAA-9185-4803-8674-198E88C77606.jpeg (69.1 KB) B632AAAA-9185-4803-8674-198E88C77606.jpeg “active “ need to be trim to “active” Sergei Shablovsky, 04/10/2023 01:45 AM
Actions #1

Updated by Jim Pingle about 1 year ago

  • Category changed from Web Interface to DHCP (IPv4)
Actions #2

Updated by Christopher Cope 10 months ago

  • Status changed from New to Pull Request Review
Actions #3

Updated by Jim Pingle 10 months 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".

Actions #4

Updated by Christopher Cope 6 months ago

Updated merge request to reflect feedback and to only trim on values where a space doesn't make sense.

Actions #5

Updated by Christian McDonald 5 months ago

  • Status changed from Pull Request Review to Feedback
  • Assignee set to Christian McDonald
Actions #6

Updated by Christian McDonald 5 months ago

  • Assignee changed from Christian McDonald to Christopher Cope
Actions #7

Updated by Christopher Cope 5 months ago

  • % Done changed from 0 to 100
Actions #8

Updated by Jordan G about 2 months ago

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.

Actions #9

Updated by Jordan G about 1 month ago

on 24.03.r.20240410.1729 adding a leading/trailing space to a search term returns no results

Actions #10

Updated by Jordan G about 1 month ago

same behavior as above using 24.03.r.20240416.0005, adding a space on either side removes any results when searching

Actions #11

Updated by Christopher Cope about 1 month 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.

Actions #12

Updated by Danilo Zrenjanin 25 days 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.

Actions

Also available in: Atom PDF