[TASK] meshviewer-ffrgb: drop site for domain

This commit is contained in:
Martin/Geno 2018-09-16 16:36:05 +02:00 committed by Geno
parent d14d3386c7
commit 7b4e3ce221
1 changed files with 7 additions and 2 deletions

View File

@ -32,8 +32,8 @@ type Node struct {
NodeID string `json:"node_id"` NodeID string `json:"node_id"`
MAC string `json:"mac"` MAC string `json:"mac"`
Addresses []string `json:"addresses"` Addresses []string `json:"addresses"`
SiteCode string `json:"site_code,omitempty"` SiteCode string `json:"-"`
DomainCode string `json:"-"` DomainCode string `json:"domain"`
Hostname string `json:"hostname"` Hostname string `json:"hostname"`
Owner string `json:"owner,omitempty"` Owner string `json:"owner,omitempty"`
Location *Location `json:"location,omitempty"` Location *Location `json:"location,omitempty"`
@ -154,5 +154,10 @@ func NewNode(nodes *runtime.Nodes, n *runtime.Node) *Node {
} }
} }
// fix site to domain - if empty
if node.DomainCode == "" {
node.DomainCode = node.SiteCode
}
return node return node
} }