mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
remove Grid struct, move cursor into own package file
This commit is contained in:
14
main.go
14
main.go
@@ -5,11 +5,18 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/bcicen/ctop/config"
|
||||
"github.com/bcicen/ctop/cwidgets/compact"
|
||||
"github.com/bcicen/ctop/logging"
|
||||
"github.com/bcicen/ctop/widgets"
|
||||
ui "github.com/gizak/termui"
|
||||
)
|
||||
|
||||
var log *logging.CTopLogger
|
||||
var (
|
||||
log *logging.CTopLogger
|
||||
cursor *GridCursor
|
||||
cGrid = compact.NewCompactGrid()
|
||||
header = widgets.NewCTopHeader()
|
||||
)
|
||||
|
||||
func main() {
|
||||
defer func() {
|
||||
@@ -19,19 +26,20 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
}()
|
||||
|
||||
config.Init()
|
||||
log = logging.Init()
|
||||
if config.GetSwitchVal("loggingEnabled") {
|
||||
logging.StartServer()
|
||||
}
|
||||
cursor = NewGridCursor()
|
||||
if err := ui.Init(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer ui.Close()
|
||||
|
||||
g := NewGrid()
|
||||
for {
|
||||
exit := Display(g)
|
||||
exit := Display()
|
||||
if exit {
|
||||
log.Notice("shutting down")
|
||||
log.Exit()
|
||||
|
||||
Reference in New Issue
Block a user