]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-top: reset filters when no fs 49041/head
authorJos Collin <jcollin@redhat.com>
Thu, 24 Nov 2022 11:59:32 +0000 (17:29 +0530)
committerJos Collin <jcollin@redhat.com>
Tue, 29 Nov 2022 11:25:50 +0000 (16:55 +0530)
Signed-off-by: Jos Collin <jcollin@redhat.com>
src/tools/cephfs/top/cephfs-top

index 0920f12b0de9bfbad3d0ece5eddb5b8912990790..6f2161fd9ea755c32ffd14d61dfa61b820697963 100755 (executable)
@@ -855,6 +855,11 @@ class FSTop(object):
             if fs not in fs_list:
                 help = f"Error: The selected filesystem '{fs}' is not available now. " \
                     "[Press 'q' to go back to home (All Filesystem Info) screen]"
+                # reset the sort/limit settings if fs_list is empty, otherwise continue the
+                # settings for the other filesystems.
+                if not fs_list:
+                    current_states["last_field"] = 'chit'
+                    current_states["limit"] = None
                 self.header.erase()  # erase previous text
                 self.fsstats.erase()
                 self.create_header(stats_json, help, screen_title, 3)
@@ -981,6 +986,9 @@ class FSTop(object):
             vscrollEnd = 0
             if not fs_list:
                 help = "INFO: No filesystem is available [Press 'q' to quit]"
+                # reset the sort/limit settings
+                current_states["last_field"] = 'chit'
+                current_states["limit"] = None
                 self.header.erase()  # erase previous text
                 self.fsstats.erase()
                 self.create_header(stats_json, help, screen_title, 2)