From 7792422ef6a87b85a68f2fe7899cb9813d7aa7ad Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Wed, 16 Nov 2022 13:26:48 +0530 Subject: [PATCH] cephfs-top: display filters in the header 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 --- src/tools/cephfs/top/cephfs-top | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tools/cephfs/top/cephfs-top b/src/tools/cephfs/top/cephfs-top index 63744ea75611a..67ff3f735966b 100755 --- a/src/tools/cephfs/top/cephfs-top +++ b/src/tools/cephfs/top/cephfs-top @@ -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: @@ -811,7 +813,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): -- 2.39.5