diff options
author | Maximilian Hils <git@maximilianhils.com> | 2020-04-11 23:59:31 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2020-04-12 00:00:45 +0200 |
commit | d33857588cc8351da17fed9ea2486b8b193bd8b8 (patch) | |
tree | ef9234846c507d9d1f03029fe81cf3462edd232c /mitmproxy/tools/console/flowlist.py | |
parent | f96b41b6e624852613ae0daced8bc8076246d243 (diff) | |
download | mitmproxy-d33857588cc8351da17fed9ea2486b8b193bd8b8.tar.gz mitmproxy-d33857588cc8351da17fed9ea2486b8b193bd8b8.tar.bz2 mitmproxy-d33857588cc8351da17fed9ea2486b8b193bd8b8.zip |
fixup flow rendering
this was a convoluted mess before and a nightmare to maintain.
the new implementation is a bit more verbose, but it can be type-checked
for errors.
Diffstat (limited to 'mitmproxy/tools/console/flowlist.py')
-rw-r--r-- | mitmproxy/tools/console/flowlist.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mitmproxy/tools/console/flowlist.py b/mitmproxy/tools/console/flowlist.py index 9650c0d3..24d4c96b 100644 --- a/mitmproxy/tools/console/flowlist.py +++ b/mitmproxy/tools/console/flowlist.py @@ -14,12 +14,17 @@ class FlowItem(urwid.WidgetWrap): def get_text(self): cols, _ = self.master.ui.get_cols_rows() + layout = self.master.options.console_flowlist_layout + if layout == "list" or (layout == 'default' and cols < 100): + render_mode = common.RenderMode.LIST + else: + render_mode = common.RenderMode.TABLE + return common.format_flow( self.flow, - self.flow is self.master.view.focus.flow, + render_mode=render_mode, + focused=self.flow is self.master.view.focus.flow, hostheader=self.master.options.showhost, - cols=cols, - layout=self.master.options.console_flowlist_layout ) def selectable(self): |