Brought back "list nodes" functionality to tctl

This commit is contained in:
Ev Kontsevoy 2016-02-27 13:34:03 -08:00
parent 02c6786521
commit 9704899dfd
3 changed files with 11 additions and 12 deletions

View file

@ -685,7 +685,7 @@ func (s *tunnelSite) handleHeartbeat(ch ssh.Channel, reqC <-chan *ssh.Request) {
s.log.Infof("agent disconnected")
return
}
s.log.Debugf("ping")
//s.log.Debugf("ping")
s.lastActive = time.Now()
}
}()

View file

@ -224,18 +224,16 @@ func (u *NodeCommand) ListActive(client *auth.TunClient) error {
if len(nodes) == 0 {
return t.String()
}
/*
for _, n := range nodes {
labels := make(configure.KeyVal, len(n.Labels)+len(n.CmdLabels))
for key, val := range n.Labels {
labels[key] = val
}
for key, val := range n.CmdLabels {
labels[key] = val.Result
}
fmt.Fprintf(t, "%v\t%v\t%v\n", n.Hostname, n.Addr, labels.String())
for _, n := range nodes {
labels := []string{}
for key, val := range n.Labels {
labels = append(labels, fmt.Sprintf("%s:%s", key, val))
}
*/
for key, val := range n.CmdLabels {
labels = append(labels, fmt.Sprintf("%s:%s", key, val.Result))
}
fmt.Fprintf(t, "%v\t%v\t%v\n", n.Hostname, n.Addr, strings.Join(labels, ","))
}
return t.String()
}
fmt.Printf(nodesView(nodes))

1
web/dist/app/app vendored Symbolic link
View file

@ -0,0 +1 @@
/home/ekontsevoy/go/src/github.com/gravitational/teleport/web/dist/app