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