func (u *NodeCommand) ListActive(client *auth.TunClient) error {
	nodes, err := client.GetNodes()
	if err != nil {
		return trace.Wrap(err)
	}
	nodesView := func(nodes []services.Server) string {
		t := goterm.NewTable(0, 10, 5, ' ', 0)
		printHeader(t, []string{"Node Name", "Node ID", "Address", "Labels"})
		if len(nodes) == 0 {
			return t.String()
		}
		for _, n := range nodes {
			fmt.Fprintf(t, "%v\t%v\t%v\t%v\n", n.Hostname, n.ID, n.Addr, n.LabelsString())
		}
		return t.String()
	}
	fmt.Printf(nodesView(nodes))
	return nil
}
// ListActive retreives the list of nodes who recently sent heartbeats to
// to a cluster and prints it to stdout
ListActive retreives the list of nodes who recently sent heartbeats to
to a cluster and prints it to stdout
// ListActive retreives the list of nodes who recently sent heartbeats to // to a cluster and prints it to stdout
func (u *NodeCommand) ListActive(client *auth.TunClient) error {
	nodes, err := client.GetNodes()
	if err != nil {
		return trace.Wrap(err)
	}
	nodesView := func(nodes []services.Server) string {
		t := goterm.NewTable(0, 10, 5, ' ', 0)
		printHeader(t, []string{"Node Name", "Node ID", "Address", "Labels"})
		if len(nodes) == 0 {
			return t.String()
		}
		for _, n := range nodes {
			fmt.Fprintf(t, "%v\t%v\t%v\t%v\n", n.Hostname, n.ID, n.Addr, n.LabelsString())
		}
		return t.String()
	}
	fmt.Printf(nodesView(nodes))
	return nil
}
func ( u * NodeCommand ) ListActive ( client * auth . TunClient ) error { nodes , err := client . GetNodes ( ) if err != nil { return trace . Wrap ( err ) } nodesView := func ( nodes [ ] services . Server ) string { t := goterm . NewTable ( 0 , 10 , 5 , ' ' , 0 ) printHeader ( t , [ ] string { " " , " " , " " , " " } ) if len ( nodes ) == 0 { return t . String ( ) } for _ , n := range nodes { fmt . Fprintf ( t , " \t \t \t \n " , n . Hostname , n . ID , n . Addr , n . LabelsString ( ) ) } return t . String ( ) } fmt . Printf ( nodesView ( nodes ) ) return nil }
ListActive retreives the list of nodes who recently sent heartbeats to
to a cluster and prints it to stdout
ListActive retreives the list of nodes who recently sent heartbeats to to a cluster and prints it to stdout