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:
Venky Shankar 2023-02-28 12:31:59 +05:30
commit dec35de185

View File

@ -445,13 +445,14 @@ class FSTop(FSTopBase):
key = 0
endwhile = False
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:
curr_row1 -= 1
elif key == curses.KEY_DOWN and curr_row1 < len(field_menu) - 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()
if curr_row1 != len(field_menu) - 1:
current_states["last_field"] = (field_menu[curr_row1].split('='))[0]
@ -465,10 +466,10 @@ class FSTop(FSTopBase):
endwhile = True
elif key == ord('q'):
self.stdscr.erase()
if self.active_screen == FS_TOP_ALL_FS_APP:
self.run_all_display()
else:
if fs_list and self.active_screen == FS_TOP_FS_SELECTED_APP:
self.run_display()
else:
self.run_all_display()
endwhile = True
try: