diff --git a/output/meshviewer-ffrgb/struct.go b/output/meshviewer-ffrgb/struct.go index 8c881c2..d5ee5e0 100644 --- a/output/meshviewer-ffrgb/struct.go +++ b/output/meshviewer-ffrgb/struct.go @@ -33,6 +33,7 @@ type Node struct { Network Network `json:"network"` SiteCode string `json:"site_code,omitempty"` Hostname string `json:"hostname"` + Owner string `json:"owner,omitempty"` Location *Location `json:"location,omitempty"` Firmware Firmware `json:"firmware,omitempty"` Autoupdater Autoupdater `json:"autoupdater"` @@ -93,6 +94,9 @@ func NewNode(nodes *runtime.Nodes, n *runtime.Node) *Node { } node.SiteCode = nodeinfo.System.SiteCode node.Hostname = nodeinfo.Hostname + if owner := nodeinfo.Owner; owner != nil { + node.Owner = owner.Contact + } if location := nodeinfo.Location; location != nil { node.Location = &Location{ Longtitude: location.Longtitude, diff --git a/output/meshviewer-ffrgb/struct_test.go b/output/meshviewer-ffrgb/struct_test.go index cf93790..fce1e69 100644 --- a/output/meshviewer-ffrgb/struct_test.go +++ b/output/meshviewer-ffrgb/struct_test.go @@ -13,6 +13,9 @@ func TestRegister(t *testing.T) { nodes := runtime.NewNodes(&runtime.Config{}) node := NewNode(nodes, &runtime.Node{ Nodeinfo: &data.NodeInfo{ + Owner: &data.Owner{ + Contact: "whoami", + }, Network: data.Network{ Mac: "blub", }, @@ -43,6 +46,7 @@ func TestRegister(t *testing.T) { }, }) assert.NotNil(node) + assert.Equal("whoami", node.Owner) assert.Equal("blub", node.Network.MAC) assert.Equal(13.3, node.Location.Longtitude) assert.Equal(8.7, node.Location.Latitude)