Add ttop example
This commit is contained in:
parent
9ec1539ccc
commit
e62b592964
@ -3,18 +3,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"bufio"
|
||||
"os"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"errors"
|
||||
"runtime"
|
||||
"github.com/marigs/termui"
|
||||
|
||||
"github.com/gizak/termui"
|
||||
"github.com/gizak/termui/extra"
|
||||
)
|
||||
|
||||
const statFilePath = "/proc/stat"
|
||||
@ -211,7 +213,6 @@ func NewCpuTabElems(width int) *CpuTabElems {
|
||||
LChart: lc}
|
||||
}
|
||||
|
||||
|
||||
func (cte *CpuTabElems) AddGauge(key string, Y int, width int) *termui.Gauge {
|
||||
cte.GMap[key] = termui.NewGauge()
|
||||
cte.GMap[key].Width = width
|
||||
@ -287,10 +288,10 @@ func main() {
|
||||
header.HasBorder = false
|
||||
header.TextBgColor = termui.ColorBlue
|
||||
|
||||
tabCpu := termui.NewTab("CPU")
|
||||
tabMem := termui.NewTab("MEM")
|
||||
tabCpu := extra.NewTab("CPU")
|
||||
tabMem := extra.NewTab("MEM")
|
||||
|
||||
tabpane := termui.NewTabpane()
|
||||
tabpane := extra.NewTabpane()
|
||||
tabpane.Y = 1
|
||||
tabpane.Width = 30
|
||||
tabpane.HasBorder = false
|
||||
@ -365,4 +366,3 @@ func main() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user