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{
|
||||
{"<enter> - open container menu", ""},
|
||||
{"", ""},
|
||||
{"[a] - toggle display of all containers", ""},
|
||||
{"[f] - filter displayed containers", ""},
|
||||
{"[h] - open this help dialog", ""},
|
||||
{"[H] - toggle ctop header", ""},
|
||||
{"[s] - select container sort field", ""},
|
||||
{"[r] - reverse container sort order", ""},
|
||||
{"[m] - Manage container (start, stop and/or remove)", ""},
|
||||
{"[l] - View container logs ([t] to toggle timestamp when open)", ""},
|
||||
{"[o] - open single view", ""},
|
||||
{"[l] - view container logs ([t] to toggle timestamp when open)", ""},
|
||||
{"[q] - exit ctop", ""},
|
||||
}
|
||||
|
||||
@ -114,7 +116,10 @@ func ContainerMenu() {
|
||||
m.Selectable = true
|
||||
|
||||
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" {
|
||||
items = append(items, menu.Item{Val: "stop", Label: "stop"})
|
||||
}
|
||||
@ -134,6 +139,9 @@ func ContainerMenu() {
|
||||
case "single":
|
||||
SingleView(c)
|
||||
ui.StopLoop()
|
||||
case "logs":
|
||||
LogMenu()
|
||||
ui.StopLoop()
|
||||
case "start":
|
||||
c.Start()
|
||||
ui.StopLoop()
|
||||
|
Loading…
Reference in New Issue
Block a user