Search fix
This commit is contained in:
parent
5727a790fb
commit
e159ad5a8c
2 changed files with 2 additions and 10 deletions
|
|
@ -11,7 +11,7 @@
|
|||
[](https://github.com/aceberg/WatchYourLAN/actions/workflows/main-docker-all.yml)
|
||||
[](https://github.com/aceberg/WatchYourLAN/actions/workflows/release.yml)
|
||||
[](https://goreportcard.com/report/github.com/aceberg/WatchYourLAN)
|
||||

|
||||
[](https://codeclimate.com/github/aceberg/WatchYourLAN/maintainability)
|
||||

|
||||
|
||||
Lightweight network IP scanner with web GUI
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue