mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
#135 Add uptime column
This commit is contained in:
@@ -17,6 +17,7 @@ var (
|
||||
"net": NewNetCol,
|
||||
"io": NewIOCol,
|
||||
"pids": NewPIDCol,
|
||||
"uptime": NewUptimeCol,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -80,6 +80,18 @@ func (w *PIDCol) SetMetrics(m models.Metrics) {
|
||||
w.Text = fmt.Sprintf("%d", m.Pids)
|
||||
}
|
||||
|
||||
type UptimeCol struct {
|
||||
*TextCol
|
||||
}
|
||||
|
||||
func NewUptimeCol() CompactCol {
|
||||
return &UptimeCol{NewTextCol("UPTIME")}
|
||||
}
|
||||
|
||||
func (w *UptimeCol) SetMeta(m models.Meta) {
|
||||
w.Text = m.Get("uptime")
|
||||
}
|
||||
|
||||
type TextCol struct {
|
||||
*ui.Par
|
||||
header string
|
||||
|
||||
Reference in New Issue
Block a user