27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/osctl/cli/top/tui/help.rb', line 27
def render
Curses.setpos(0, 0)
Curses.addstr('Key bindings:')
pos = 0
[
['q', 'Quit'],
['<, >, left, right', 'Change sort column'],
['r, R', 'Reverse sort order'],
['up, down', 'Select containers'],
['space', 'Highlight selected container'],
['enter, t', 'Open top and filter container processes'],
['h', 'Open htop and filter container processes'],
['PageDown', 'Scroll down'],
['PageUp', 'Scroll up'],
['Home', 'Scroll to the top'],
['End', 'Scroll to the bottom'],
['m', 'Toggle between realtime and cumulative mode'],
['p', 'Pause/unpause resource tracking'],
['/', 'Filter containers by ID. Confirm by enter, cancel by esc'],
['?', 'Show/hide this help message']
].each_with_index do |arr, i|
key, desc = arr
Curses.setpos(i + 2, 4)
Curses.addstr(format('%20s - %s', key, desc))
pos = i + 2
end
Curses.setpos(pos + 2, 0)
Curses.addstr("Press 'q', '?' or <Esc> to continue")
end
|