add more site names.
This commit is contained in:
parent
381ad45f12
commit
d2519412c4
|
|
@ -19,7 +19,7 @@
|
||||||
"v2",
|
"v2",
|
||||||
]
|
]
|
||||||
pruneopts = "UT"
|
pruneopts = "UT"
|
||||||
revision = "16c852ea613fa2d42fcdccc9a8b0802a8bdc6140"
|
revision = "8ff2fc3824fcb533795f9a2f233275f0bb18d6c5"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b"
|
digest = "1:cf31692c14422fa27c83a05292eb5cbe0fb2775972e8f1f8446a71549bd8980b"
|
||||||
|
|
|
||||||
|
|
@ -333,6 +333,7 @@ type UAP struct {
|
||||||
RxNwids float64 `json:"rx_nwids"`
|
RxNwids float64 `json:"rx_nwids"`
|
||||||
RxPackets float64 `json:"rx_packets"`
|
RxPackets float64 `json:"rx_packets"`
|
||||||
SiteID string `json:"site_id"`
|
SiteID string `json:"site_id"`
|
||||||
|
SiteName string `json:"-"`
|
||||||
State string `json:"state"`
|
State string `json:"state"`
|
||||||
T string `json:"t"`
|
T string `json:"t"`
|
||||||
TxBytes float64 `json:"tx_bytes"`
|
TxBytes float64 `json:"tx_bytes"`
|
||||||
|
|
|
||||||
|
|
@ -95,9 +95,15 @@ func (u *Unifi) GetDevices(sites []Site) (*Devices, error) {
|
||||||
// Add SiteName to each device asset.
|
// Add SiteName to each device asset.
|
||||||
for i := range loopDevices.UAPs {
|
for i := range loopDevices.UAPs {
|
||||||
loopDevices.UAPs[i].SiteName = site.Name
|
loopDevices.UAPs[i].SiteName = site.Name
|
||||||
|
for j := range loopDevices.UAPs[i].VapTable {
|
||||||
|
loopDevices.UAPs[i].VapTable[j].SiteName = site.Name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for i := range loopDevices.USGs {
|
for i := range loopDevices.USGs {
|
||||||
loopDevices.USGs[i].SiteName = site.Name
|
loopDevices.USGs[i].SiteName = site.Name
|
||||||
|
for j := range loopDevices.USGs[i].NetworkTable {
|
||||||
|
loopDevices.USGs[i].NetworkTable[j].SiteName = site.Name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for i := range loopDevices.USWs {
|
for i := range loopDevices.USWs {
|
||||||
loopDevices.USWs[i].SiteName = site.Name
|
loopDevices.USWs[i].SiteName = site.Name
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ type USG struct {
|
||||||
RxBytes FlexInt `json:"rx_bytes"`
|
RxBytes FlexInt `json:"rx_bytes"`
|
||||||
RxPackets float64 `json:"rx_packets"`
|
RxPackets float64 `json:"rx_packets"`
|
||||||
SiteID string `json:"site_id"`
|
SiteID string `json:"site_id"`
|
||||||
|
SiteName string `json:"-"`
|
||||||
TxBytes FlexInt `json:"tx_bytes"`
|
TxBytes FlexInt `json:"tx_bytes"`
|
||||||
TxPackets float64 `json:"tx_packets"`
|
TxPackets float64 `json:"tx_packets"`
|
||||||
Up FlexBool `json:"up"`
|
Up FlexBool `json:"up"`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue