mirror of
https://github.com/ceph/ceph
synced 2025-01-04 02:02:36 +00:00
Merge PR #50197 into main
* refs/pull/50197/head: cephfs-top: navigate to home screen while selecting sort field, if no filesystems. cephfs-top: display_menu() isn't triggered when all fs' are removed Reviewed-by: Jos Collin <jcollin@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
commit
dec35de185
@ -445,13 +445,14 @@ class FSTop(FSTopBase):
|
|||||||
key = 0
|
key = 0
|
||||||
endwhile = False
|
endwhile = False
|
||||||
while not endwhile:
|
while not endwhile:
|
||||||
global current_states
|
global current_states, fs_list
|
||||||
|
fs_list = self.get_fs_names()
|
||||||
|
|
||||||
if key == curses.KEY_UP and curr_row1 > 0:
|
if key == curses.KEY_UP and curr_row1 > 0:
|
||||||
curr_row1 -= 1
|
curr_row1 -= 1
|
||||||
elif key == curses.KEY_DOWN and curr_row1 < len(field_menu) - 1:
|
elif key == curses.KEY_DOWN and curr_row1 < len(field_menu) - 1:
|
||||||
curr_row1 += 1
|
curr_row1 += 1
|
||||||
elif key == curses.KEY_ENTER or key in [10, 13]:
|
elif (key in [curses.KEY_ENTER, 10, 13]) and fs_list:
|
||||||
self.stdscr.erase()
|
self.stdscr.erase()
|
||||||
if curr_row1 != len(field_menu) - 1:
|
if curr_row1 != len(field_menu) - 1:
|
||||||
current_states["last_field"] = (field_menu[curr_row1].split('='))[0]
|
current_states["last_field"] = (field_menu[curr_row1].split('='))[0]
|
||||||
@ -465,10 +466,10 @@ class FSTop(FSTopBase):
|
|||||||
endwhile = True
|
endwhile = True
|
||||||
elif key == ord('q'):
|
elif key == ord('q'):
|
||||||
self.stdscr.erase()
|
self.stdscr.erase()
|
||||||
if self.active_screen == FS_TOP_ALL_FS_APP:
|
if fs_list and self.active_screen == FS_TOP_FS_SELECTED_APP:
|
||||||
self.run_all_display()
|
|
||||||
else:
|
|
||||||
self.run_display()
|
self.run_display()
|
||||||
|
else:
|
||||||
|
self.run_all_display()
|
||||||
endwhile = True
|
endwhile = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user