From 607d86965e01fa8972947027e2811cad55331efb Mon Sep 17 00:00:00 2001 From: Nikita Stupin <18281368+nikitastupin@users.noreply.github.com> Date: Sat, 2 May 2020 12:49:02 +0300 Subject: Colorize arrows! --- mitmproxy/tools/console/flowview.py | 4 ++-- mitmproxy/tools/console/palettes.py | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/mitmproxy/tools/console/flowview.py b/mitmproxy/tools/console/flowview.py index bed0a290..a4d14744 100644 --- a/mitmproxy/tools/console/flowview.py +++ b/mitmproxy/tools/console/flowview.py @@ -144,9 +144,9 @@ class FlowDetails(tabs.Tabs): for line in lines: if message["from_client"]: - line.insert(0, f"{common.SYMBOL_FROM_CLIENT} ") + line.insert(0, ("from_client", f"{common.SYMBOL_FROM_CLIENT} ")) else: - line.insert(0, f"{common.SYMBOL_TO_CLIENT} ") + line.insert(0, ("to_client", f"{common.SYMBOL_TO_CLIENT} ")) widget_lines.append(urwid.Text(line)) diff --git a/mitmproxy/tools/console/palettes.py b/mitmproxy/tools/console/palettes.py index a680a5a7..15745df5 100644 --- a/mitmproxy/tools/console/palettes.py +++ b/mitmproxy/tools/console/palettes.py @@ -37,6 +37,9 @@ class Palette: # JSON view 'json_string', 'json_number', 'json_boolean', + # TCP flow details + 'from_client', 'to_client', + # Grid Editor 'focusfield', 'focusfield_error', 'field_error', 'editfield', @@ -177,6 +180,10 @@ class LowDark(Palette): json_number = ('light magenta', 'default'), json_boolean = ('dark magenta', 'default'), + # TCP flow details + from_client = ('light blue', 'default'), + to_client = ('light red', 'default'), + # Grid Editor focusfield = ('black', 'light gray'), focusfield_error = ('dark red', 'light gray'), @@ -282,6 +289,10 @@ class LowLight(Palette): json_number = ('light magenta', 'default'), json_boolean = ('dark magenta', 'default'), + # TCP flow details + from_client = ('dark blue', 'default'), + to_client = ('dark red', 'default'), + # Grid Editor focusfield = ('black', 'light gray'), focusfield_error = ('dark red', 'light gray'), @@ -397,6 +408,10 @@ class SolarizedLight(LowLight): json_number = (sol_blue, 'default'), json_boolean = (sol_magenta, 'default'), + # TCP flow details + from_client = (sol_blue, 'default'), + to_client = (sol_red, 'default'), + # Grid Editor focusfield = (sol_base00, sol_base2), focusfield_error = (sol_red, sol_base2), @@ -475,6 +490,10 @@ class SolarizedDark(LowDark): json_number = (sol_blue, 'default'), json_boolean = (sol_magenta, 'default'), + # TCP flow details + from_client = (sol_blue, 'default'), + to_client = (sol_red, 'default'), + # Grid Editor focusfield = (sol_base0, sol_base02), focusfield_error = (sol_red, sol_base02), -- cgit v1.2.3