]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-top: display filters in the header
authorJos Collin <jcollin@redhat.com>
Wed, 16 Nov 2022 07:56:48 +0000 (13:26 +0530)
committerJos Collin <jcollin@redhat.com>
Wed, 29 Mar 2023 08:52:04 +0000 (14:22 +0530)
This would help the user to identify what are the filters currently applied
to the cephfs-top screens at a glance.

Signed-off-by: Jos Collin <jcollin@redhat.com>
(cherry picked from commit 7792422ef6a87b85a68f2fe7899cb9813d7aa7ad)

src/tools/cephfs/top/cephfs-top

index 845ca447e30bc47477163026534d3e249808043e..aabb228b6a8cae74f6400b23b76ce91d5e48e26e 100755 (executable)
@@ -351,6 +351,7 @@ class FSTop(object):
                     current_states["last_field"] = (field_menu[curr_row1].split('='))[0]
                 else:
                     current_states["last_field"] = 'chit'
+                self.header.erase()  # erase the previous text
                 if isinstance(last_fs, list):
                     self.run_all_display()
                 else:
@@ -452,6 +453,7 @@ class FSTop(object):
                     elif int(key) != 0:
                         current_states["limit"] = key[:-1]
                 self.stdscr.erase()
+                self.header.erase()  # erase the previous text
                 if isinstance(current_states['last_fs'], list):
                     self.run_all_display()
                 else:
@@ -820,7 +822,9 @@ class FSTop(object):
                                                                  num_mounts=num_mounts,
                                                                  num_kclients=num_kclients,
                                                                  num_libs=num_libs), curses.A_DIM)
-        self.header.addstr(4, 0, help, curses.A_DIM)
+        self.header.addstr(4, 0, f"Filters: Sort - {current_states['last_field']}, "
+                           f"Limit - {current_states['limit']}", curses.A_DIM)
+        self.header.addstr(5, 0, help, curses.A_DIM)
         return True
 
     def run_display(self):