Search fix

This commit is contained in:
aceberg 2023-01-03 19:39:49 +07:00
parent 5727a790fb
commit e159ad5a8c
2 changed files with 2 additions and 10 deletions

View file

@ -11,7 +11,7 @@
[![Docker](https://github.com/aceberg/WatchYourLAN/actions/workflows/main-docker-all.yml/badge.svg)](https://github.com/aceberg/WatchYourLAN/actions/workflows/main-docker-all.yml)
[![Binary-release](https://github.com/aceberg/WatchYourLAN/actions/workflows/release.yml/badge.svg)](https://github.com/aceberg/WatchYourLAN/actions/workflows/release.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/aceberg/WatchYourLAN)](https://goreportcard.com/report/github.com/aceberg/WatchYourLAN)
![GitHub](https://img.shields.io/github/license/aceberg/WatchYourLAN)
[![Maintainability](https://api.codeclimate.com/v1/badges/46b17f99edc1726b5d7d/maintainability)](https://codeclimate.com/github/aceberg/WatchYourLAN/maintainability)
![Docker Image Size (latest semver)](https://img.shields.io/docker/image-size/aceberg/watchyourlan)
Lightweight network IP scanner with web GUI

View file

@ -12,15 +12,7 @@ func searchHandler(w http.ResponseWriter, r *http.Request) {
foundHosts := []models.Host{}
for _, oneHost := range AllHosts {
if inString(oneHost.Name, search) {
foundHosts = append(foundHosts, oneHost)
} else if inString(oneHost.IP, search) {
foundHosts = append(foundHosts, oneHost)
} else if inString(oneHost.Mac, search) {
foundHosts = append(foundHosts, oneHost)
} else if inString(oneHost.Date, search) {
foundHosts = append(foundHosts, oneHost)
} else if inString(oneHost.Hw, search) {
if inString(oneHost.Name, search) || inString(oneHost.IP, search) || inString(oneHost.Mac, search) || inString(oneHost.Hw, search) || inString(oneHost.Date, search) {
foundHosts = append(foundHosts, oneHost)
}
}