Project

General

Profile

Actions

Bug #14261

closed
SS CC

Trim white space in a DHCP Leases page search field

Bug #14261: Trim white space in a DHCP Leases page search field

Added by Sergei Shablovsky over 3 years ago. Updated over 2 years 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

JP Updated by Jim Pingle over 3 years ago Actions #1

  • Category changed from Web Interface to DHCP (IPv4)

CC Updated by Christopher Cope about 3 years ago Actions #2

  • Status changed from New to Pull Request Review

JP Updated by Jim Pingle about 3 years ago Actions #3

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".

CC Updated by Christopher Cope over 2 years ago Actions #4

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

CM Updated by Christian McDonald over 2 years ago Actions #5

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

CM Updated by Christian McDonald over 2 years ago Actions #6

  • Assignee changed from Christian McDonald to Christopher Cope

CC Updated by Christopher Cope over 2 years ago Actions #7

  • % Done changed from 0 to 100

Applied in changeset commit:8c2615a322f4c7ae04d97efb16159904b0503160.

JG Updated by Jordan G over 2 years ago Actions #8

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.

JG Updated by Jordan G over 2 years ago Actions #9

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

JG Updated by Jordan G over 2 years ago Actions #10

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

CC Updated by Christopher Cope over 2 years ago Actions #11

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.

DZ Updated by Danilo Zrenjanin over 2 years ago Actions #12

  • 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