Skip to content

Commit a431253

Browse files
committed
cmd(profile): v key stroke for switching LogType in TUI
Signed-off-by: tesla59 <[email protected]>
1 parent 5b3b425 commit a431253

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

profile/Client/Keys.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ type keyMap struct {
1414
Arrow key.Binding
1515
MaxRow key.Binding
1616
Filter key.Binding
17+
View key.Binding
1718
}
1819

1920
func (k keyMap) FullHelp() [][]key.Binding {
20-
return [][]key.Binding{{k.Quit, k.Tab, k.Arrow, k.MaxRow, k.Filter}}
21+
return [][]key.Binding{{k.Quit, k.Tab, k.Arrow, k.MaxRow, k.Filter, k.View}}
2122
}
2223

2324
var keys = keyMap{
@@ -41,4 +42,8 @@ var keys = keyMap{
4142
key.WithKeys(""),
4243
key.WithHelp("", "(/) To filter the tables, Press <Esc> to clear filter"),
4344
),
45+
View: key.NewBinding(
46+
key.WithKeys(""),
47+
key.WithHelp("", "(v) Switch between ContainerLog and HostLog"),
48+
),
4449
}

profile/Client/profileClient.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
195195
m.Network = m.Network.WithPageSize(m.Network.PageSize() + 1)
196196
m.Process = m.Process.WithPageSize(m.Process.PageSize() + 1)
197197
m.Syscall = m.Syscall.WithPageSize(m.Syscall.PageSize() + 1)
198+
case "v":
199+
m.profileOptions.LogType = map[string]string{"ContainerLog": "HostLog", "HostLog": "ContainerLog"}[m.profileOptions.LogType]
198200
}
199201
switch m.state {
200202
case processview:

0 commit comments

Comments
 (0)