mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
add logs to container menu
This commit is contained in:
parent
c958e4c34e
commit
8b5eb21ac3
14
menus.go
14
menus.go
@ -12,14 +12,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var helpDialog = []menu.Item{
|
var helpDialog = []menu.Item{
|
||||||
|
{"<enter> - open container menu", ""},
|
||||||
|
{"", ""},
|
||||||
{"[a] - toggle display of all containers", ""},
|
{"[a] - toggle display of all containers", ""},
|
||||||
{"[f] - filter displayed containers", ""},
|
{"[f] - filter displayed containers", ""},
|
||||||
{"[h] - open this help dialog", ""},
|
{"[h] - open this help dialog", ""},
|
||||||
{"[H] - toggle ctop header", ""},
|
{"[H] - toggle ctop header", ""},
|
||||||
{"[s] - select container sort field", ""},
|
{"[s] - select container sort field", ""},
|
||||||
{"[r] - reverse container sort order", ""},
|
{"[r] - reverse container sort order", ""},
|
||||||
{"[m] - Manage container (start, stop and/or remove)", ""},
|
{"[o] - open single view", ""},
|
||||||
{"[l] - View container logs ([t] to toggle timestamp when open)", ""},
|
{"[l] - view container logs ([t] to toggle timestamp when open)", ""},
|
||||||
{"[q] - exit ctop", ""},
|
{"[q] - exit ctop", ""},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +116,10 @@ func ContainerMenu() {
|
|||||||
m.Selectable = true
|
m.Selectable = true
|
||||||
|
|
||||||
m.BorderLabel = "Menu"
|
m.BorderLabel = "Menu"
|
||||||
items := []menu.Item{menu.Item{Val: "single", Label: "single view"}}
|
items := []menu.Item{
|
||||||
|
menu.Item{Val: "single", Label: "single view"},
|
||||||
|
menu.Item{Val: "logs", Label: "log view"},
|
||||||
|
}
|
||||||
if c.Meta["state"] == "running" {
|
if c.Meta["state"] == "running" {
|
||||||
items = append(items, menu.Item{Val: "stop", Label: "stop"})
|
items = append(items, menu.Item{Val: "stop", Label: "stop"})
|
||||||
}
|
}
|
||||||
@ -134,6 +139,9 @@ func ContainerMenu() {
|
|||||||
case "single":
|
case "single":
|
||||||
SingleView(c)
|
SingleView(c)
|
||||||
ui.StopLoop()
|
ui.StopLoop()
|
||||||
|
case "logs":
|
||||||
|
LogMenu()
|
||||||
|
ui.StopLoop()
|
||||||
case "start":
|
case "start":
|
||||||
c.Start()
|
c.Start()
|
||||||
ui.StopLoop()
|
ui.StopLoop()
|
||||||
|
Loading…
Reference in New Issue
Block a user