Dashboard updates (#1087)
This commit is contained in:
parent
bbf81f2479
commit
7bc1944a08
@ -338,7 +338,7 @@ func dashCmd(cmd *cobra.Command, args []string) (err error) {
|
|||||||
_, _ = heading.Printf("\nStorage Node Dashboard Stats\n")
|
_, _ = heading.Printf("\nStorage Node Dashboard Stats\n")
|
||||||
_, _ = heading.Printf("\n===============================\n")
|
_, _ = heading.Printf("\n===============================\n")
|
||||||
|
|
||||||
fmt.Fprintf(color.Output, "Node ID: %s\n", color.BlueString(data.GetNodeId()))
|
fmt.Fprintf(color.Output, "Node ID: %s\n", color.YellowString(data.GetNodeId()))
|
||||||
|
|
||||||
if data.GetConnection() {
|
if data.GetConnection() {
|
||||||
fmt.Fprintf(color.Output, "%s ", color.GreenString("ONLINE"))
|
fmt.Fprintf(color.Output, "%s ", color.GreenString("ONLINE"))
|
||||||
@ -355,11 +355,11 @@ func dashCmd(cmd *cobra.Command, args []string) (err error) {
|
|||||||
|
|
||||||
fmt.Fprintf(color.Output, "Node Connections: %+v\n", whiteInt(data.GetNodeConnections()))
|
fmt.Fprintf(color.Output, "Node Connections: %+v\n", whiteInt(data.GetNodeConnections()))
|
||||||
|
|
||||||
color.Green("\nIO\t\tAvailable\tUsed\n--\t\t---------\t----")
|
color.Green("\nIO\t\t\tAvailable\t\t\tUsed\n--\t\t\t---------\t\t\t----")
|
||||||
stats := data.GetStats()
|
stats := data.GetStats()
|
||||||
if stats != nil {
|
if stats != nil {
|
||||||
fmt.Fprintf(color.Output, "Bandwidth\t%+v\t%+v\n", whiteInt(stats.GetAvailableBandwidth()), whiteInt(stats.GetUsedBandwidth()))
|
fmt.Fprintf(color.Output, "Bandwidth\t\t%+v\t\t\t%+v\n", whiteInt(stats.GetAvailableBandwidth()), whiteInt(stats.GetUsedBandwidth()))
|
||||||
fmt.Fprintf(color.Output, "Disk\t\t%+v\t%+v\n", whiteInt(stats.GetAvailableSpace()), whiteInt(stats.GetUsedSpace()))
|
fmt.Fprintf(color.Output, "Disk\t\t\t%+v\t\t\t%+v\n", whiteInt(stats.GetAvailableSpace()), whiteInt(stats.GetUsedSpace()))
|
||||||
} else {
|
} else {
|
||||||
color.Yellow("Loading...")
|
color.Yellow("Loading...")
|
||||||
}
|
}
|
||||||
|
@ -347,7 +347,7 @@ func (s *Server) getDashboardData(ctx context.Context) (*pb.DashboardStats, erro
|
|||||||
return &pb.DashboardStats{}, ServerError.Wrap(err)
|
return &pb.DashboardStats{}, ServerError.Wrap(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
nodes, err := s.kad.GetNodes(ctx, rt.Local().Id, 10000)
|
nodes, err := s.kad.GetNodes(ctx, rt.Local().Id, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &pb.DashboardStats{}, ServerError.Wrap(err)
|
return &pb.DashboardStats{}, ServerError.Wrap(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user