bugfix, if/else
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Stefan Hoffmann 2021-02-14 00:28:49 +01:00
parent 7e1841a244
commit ad8088f1c1

69
main.go
View File

@ -255,7 +255,6 @@ func processAPIs() {
nodes = append(nodes, mvNodes...) nodes = append(nodes, mvNodes...)
links = append(links, mvLinks...) links = append(links, mvLinks...)
} }
// assemble final struct // assemble final struct
o := output{ o := output{
Timestamp: time.Now().Format(iso8601), Timestamp: time.Now().Format(iso8601),
@ -547,41 +546,39 @@ func addmvDevices(d mvDevices) ([]node, []link) {
Model: mvNode.Model, Model: mvNode.Model,
}) })
} else { } else {
if mvNode.Location.Latitude == 0 { nodes = append(nodes, node{
nodes = append(nodes, node{ Firstseen: mvNode.Firstseen,
Firstseen: mvNode.Firstseen, Lastseen: mvNode.Lastseen,
Lastseen: mvNode.Lastseen, IsOnline: mvNode.IsOnline,
IsOnline: mvNode.IsOnline, IsGateway: mvNode.IsGateway,
IsGateway: mvNode.IsGateway, Clients: mvNode.Clients,
Clients: mvNode.Clients, ClientsWifi24: mvNode.ClientsWifi24,
ClientsWifi24: mvNode.ClientsWifi24, ClientsWifi5: mvNode.ClientsWifi5,
ClientsWifi5: mvNode.ClientsWifi5, ClientsOther: mvNode.ClientsOther,
ClientsOther: mvNode.ClientsOther, RootFSUsage: int(mvNode.RootfsUsage),
RootFSUsage: int(mvNode.RootfsUsage), LoadAVG: mvNode.Loadavg,
LoadAVG: mvNode.Loadavg, MemoryUsage: mvNode.MemoryUsage,
MemoryUsage: mvNode.MemoryUsage, Uptime: mvNode.Uptime,
Uptime: mvNode.Uptime, GatewayNexthop: mvNode.GatewayNexthop,
GatewayNexthop: mvNode.GatewayNexthop, Gateway: mvNode.Gateway,
Gateway: mvNode.Gateway, Location: &mvNode.Location,
Location: &mvNode.Location, NodeID: mvNode.NodeID,
NodeID: mvNode.NodeID, MAC: mvNode.Mac,
MAC: mvNode.Mac, Adresses: mvNode.Addresses,
Adresses: mvNode.Addresses, Domain: mvNode.Domain,
Domain: mvNode.Domain, Hostname: mvNode.Hostname,
Hostname: mvNode.Hostname, Owner: mvNode.Owner,
Owner: mvNode.Owner, Firmware: firmware{
Firmware: firmware{ Base: mvNode.Firmware.Base,
Base: mvNode.Firmware.Base, Release: mvNode.Firmware.Release,
Release: mvNode.Firmware.Release, },
}, Autoupdater: autoupdater{
Autoupdater: autoupdater{ Enabled: mvNode.Autoupdater.Enabled,
Enabled: mvNode.Autoupdater.Enabled, Branch: mvNode.Autoupdater.Branch,
Branch: mvNode.Autoupdater.Branch, },
}, NProc: mvNode.Nproc,
NProc: mvNode.Nproc, Model: mvNode.Model,
Model: mvNode.Model, })
})
}
} }
} }
for i := range d.Links { for i := range d.Links {