mirror of
https://github.com/jsiebens/ionscale.git
synced 2026-03-31 15:07:49 +01:00
display tags instead of user
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/muesli/coral"
|
||||
"github.com/nleeper/goment"
|
||||
"github.com/rodaine/table"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func machineCommands() *coral.Command {
|
||||
@@ -88,7 +89,7 @@ func listMachinesCommand() *coral.Command {
|
||||
return err
|
||||
}
|
||||
|
||||
tbl := table.New("ID", "TAILNET", "NAME", "IPv4", "IPv6", "EPHEMERAL", "LAST_SEEN", "USER")
|
||||
tbl := table.New("ID", "TAILNET", "NAME", "IPv4", "IPv6", "EPHEMERAL", "LAST_SEEN", "TAGS")
|
||||
for _, m := range resp.Machines {
|
||||
var lastSeen = "N/A"
|
||||
if m.Connected {
|
||||
@@ -99,7 +100,7 @@ func listMachinesCommand() *coral.Command {
|
||||
lastSeen = mom.FromNow()
|
||||
}
|
||||
}
|
||||
tbl.AddRow(m.Id, m.Tailnet.Name, m.Name, m.Ipv4, m.Ipv6, m.Ephemeral, lastSeen, m.User.Name)
|
||||
tbl.AddRow(m.Id, m.Tailnet.Name, m.Name, m.Ipv4, m.Ipv6, m.Ephemeral, lastSeen, strings.Join(m.Tags, ","))
|
||||
}
|
||||
tbl.Print()
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ func (s *Service) ListMachines(ctx context.Context, req *api.ListMachinesRequest
|
||||
Ipv4: m.IPv4,
|
||||
Ipv6: m.IPv6,
|
||||
Ephemeral: m.Ephemeral,
|
||||
Tags: m.Tags,
|
||||
LastSeen: lastSeen,
|
||||
Connected: online,
|
||||
Tailnet: &api.Ref{
|
||||
|
||||
Reference in New Issue
Block a user