Bugfix Doppelte Einträge
All checks were successful
release-tag / release-image (push) Successful in 1m56s
All checks were successful
release-tag / release-image (push) Successful in 1m56s
This commit is contained in:
20
main.go
20
main.go
@@ -130,18 +130,18 @@ func handleRange(w http.ResponseWriter, r *http.Request) {
|
||||
d.Error = err.Error()
|
||||
} else {
|
||||
d.HaveResult = true
|
||||
d.Rows = rows
|
||||
}
|
||||
for a, b := range rows {
|
||||
fmt.Println(a, b)
|
||||
octets := strings.Split(b.IPv4, ".")
|
||||
if len(octets) != 4 {
|
||||
fmt.Println("Ungültige IP-Adresse!")
|
||||
return
|
||||
for a, b := range rows {
|
||||
fmt.Println(a, b)
|
||||
octets := strings.Split(b.IPv4, ".")
|
||||
if len(octets) != 4 {
|
||||
fmt.Println("Ungültige IP-Adresse!")
|
||||
return
|
||||
}
|
||||
N := "PC" + octets[2] + octets[3]
|
||||
d.Rows = append(d.Rows, addrPair{IPv4: b.IPv4, IPv6: b.IPv6, Name: N})
|
||||
}
|
||||
N := "PC" + octets[2] + octets[3]
|
||||
d.Rows = append(d.Rows, addrPair{IPv4: b.IPv4, IPv6: b.IPv6, Name: N})
|
||||
}
|
||||
|
||||
renderRange(w, d)
|
||||
default:
|
||||
http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
|
||||
|
Reference in New Issue
Block a user