mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
Additional columns
This commit is contained in:
parent
9545dfba31
commit
491cd85b4d
@ -21,6 +21,26 @@ var defaultColumns = []Column{
|
|||||||
Label: "Container ID",
|
Label: "Container ID",
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "image",
|
||||||
|
Label: "Image name",
|
||||||
|
Enabled: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Name: "ports",
|
||||||
|
Label: "Exposed ports",
|
||||||
|
Enabled: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Name: "IPs",
|
||||||
|
Label: "Exposed IPs",
|
||||||
|
Enabled: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Name: "created",
|
||||||
|
Label: "Date created",
|
||||||
|
Enabled: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "cpu",
|
Name: "cpu",
|
||||||
Label: "CPU Usage",
|
Label: "CPU Usage",
|
||||||
|
@ -9,15 +9,19 @@ import (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
allCols = map[string]NewCompactColFn{
|
allCols = map[string]NewCompactColFn{
|
||||||
"status": NewStatus,
|
"status": NewStatus,
|
||||||
"name": NewNameCol,
|
"name": NewNameCol,
|
||||||
"id": NewCIDCol,
|
"id": NewCIDCol,
|
||||||
"cpu": NewCPUCol,
|
"image": NewImageCol,
|
||||||
"cpus": NewCpuScaledCol,
|
"ports": NewPortsCol,
|
||||||
"mem": NewMemCol,
|
"IPs": NewIpsCol,
|
||||||
"net": NewNetCol,
|
"created": NewCreatedCol,
|
||||||
"io": NewIOCol,
|
"cpu": NewCPUCol,
|
||||||
"pids": NewPIDCol,
|
"cpus": NewCpuScaledCol,
|
||||||
|
"mem": NewMemCol,
|
||||||
|
"net": NewNetCol,
|
||||||
|
"io": NewIOCol,
|
||||||
|
"pids": NewPIDCol,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -31,6 +31,24 @@ func NewCIDCol() CompactCol {
|
|||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewImageCol() CompactCol {
|
||||||
|
return &MetaCol{NewTextCol("IMAGE"), "image"}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewPortsCol() CompactCol {
|
||||||
|
return &MetaCol{NewTextCol("PORTS"), "ports"}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewIpsCol() CompactCol {
|
||||||
|
return &MetaCol{NewTextCol("IPs"), "IPs"}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCreatedCol() CompactCol {
|
||||||
|
c := &MetaCol{NewTextCol("CREATED"), "created"}
|
||||||
|
c.fWidth = 19 // Year will be stripped e.g. "Thu Nov 26 07:44:03" without 2020 at end
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
type NetCol struct {
|
type NetCol struct {
|
||||||
*TextCol
|
*TextCol
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user