mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
Merge pull request #211 from stokito/truncate_column
text.go: to do not manually truncate id and name columns
This commit is contained in:
@@ -19,10 +19,6 @@ func NewNameCol() CompactCol {
|
|||||||
|
|
||||||
func (w *NameCol) SetMeta(m models.Meta) {
|
func (w *NameCol) SetMeta(m models.Meta) {
|
||||||
w.Text = m.Get("name")
|
w.Text = m.Get("name")
|
||||||
// truncate container id
|
|
||||||
if len(w.Text) > 12 {
|
|
||||||
w.Text = w.Text[:12]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type CIDCol struct {
|
type CIDCol struct {
|
||||||
@@ -35,9 +31,6 @@ func NewCIDCol() CompactCol {
|
|||||||
|
|
||||||
func (w *CIDCol) SetMeta(m models.Meta) {
|
func (w *CIDCol) SetMeta(m models.Meta) {
|
||||||
w.Text = m.Get("id")
|
w.Text = m.Get("id")
|
||||||
if len(w.Text) > 12 {
|
|
||||||
w.Text = w.Text[:12]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type NetCol struct {
|
type NetCol struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user