From 7b4e3ce2215b7a692b92962c48a0b8d033266527 Mon Sep 17 00:00:00 2001 From: Martin/Geno Date: Sun, 16 Sep 2018 16:36:05 +0200 Subject: [PATCH] [TASK] meshviewer-ffrgb: drop site for domain --- output/meshviewer-ffrgb/struct.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/output/meshviewer-ffrgb/struct.go b/output/meshviewer-ffrgb/struct.go index 398401e..a6db356 100644 --- a/output/meshviewer-ffrgb/struct.go +++ b/output/meshviewer-ffrgb/struct.go @@ -32,8 +32,8 @@ type Node struct { NodeID string `json:"node_id"` MAC string `json:"mac"` Addresses []string `json:"addresses"` - SiteCode string `json:"site_code,omitempty"` - DomainCode string `json:"-"` + SiteCode string `json:"-"` + DomainCode string `json:"domain"` Hostname string `json:"hostname"` Owner string `json:"owner,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 }