Skip to content

Commit

Permalink
UI Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vs4vijay committed Apr 19, 2020
1 parent 35fae5e commit 9d84a45
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/tui/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ func layout(g *gocui.Gui) error {
v.Highlight = true
v.SelBgColor = gocui.ColorGreen
v.SelFgColor = gocui.ColorBlack
// v.Autoscroll = true
}

if v, err := g.SetView("Services", 0, gridY*2, gridX*4, gridY*3); err != nil {
Expand All @@ -132,6 +131,7 @@ func layout(g *gocui.Gui) error {
}

func quit(g *gocui.Gui, v *gocui.View) error {
fmt.Printf("%+v", state)
return gocui.ErrQuit
}

Expand Down Expand Up @@ -197,7 +197,7 @@ func onSelectMain(g *gocui.Gui, view *gocui.View) error {
selectedData = strings.Fields(selectedData)[0]

if strings.HasPrefix(view.Title, "Pods") {
// Handling for Pods View
// Building Containers View
state["pod"] = selectedData

g.Update(func(g *gocui.Gui) error {
Expand All @@ -213,18 +213,20 @@ func onSelectMain(g *gocui.Gui, view *gocui.View) error {
return nil
})
} else if strings.HasPrefix(view.Title, "Containers") {
// Handling for Pods View
// Building Logs View
state["container"] = selectedData

g.Update(func(g *gocui.Gui) error {
view.Clear()
view.Title = fmt.Sprintf("Logs - %v", state["container"])
view.Highlight = false
view.Autoscroll = true
// view.Editable = true
// view.Wrap = true
// view.FgColor = gocui.ColorWhite
// view.SelBgColor = gocui.ColorBlue


app.kubeapi.GetContainerLogs(state["namespace"], state["pod"], state["container"], view)
return nil
})
Expand Down

0 comments on commit 9d84a45

Please sign in to comment.