mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-01-30 14:58:38 +00:00
Merge pull request #1428 from dufferzafar/replay
Consolidate replay under R
This commit is contained in:
commit
38b43cc9f9
@ -49,12 +49,11 @@ class HelpView(urwid.ListBox):
|
||||
|
||||
text.append(urwid.Text([("head", "\n\nGlobal keys:\n")]))
|
||||
keys = [
|
||||
("c", "client replay of HTTP requests"),
|
||||
("i", "set interception pattern"),
|
||||
("o", "options"),
|
||||
("q", "quit / return to previous page"),
|
||||
("Q", "quit without confirm prompt"),
|
||||
("S", "server replay of HTTP responses"),
|
||||
("R", "replay of HTTP requests/responses"),
|
||||
]
|
||||
text.extend(
|
||||
common.format_keyvals(keys, key="key", val="text", indent=4)
|
||||
|
@ -38,15 +38,12 @@ class Window(urwid.Frame):
|
||||
return False
|
||||
return True
|
||||
|
||||
def keypress(self, size, k):
|
||||
k = super(self.__class__, self).keypress(size, k)
|
||||
if k == "?":
|
||||
self.master.view_help(self.helpctx)
|
||||
elif k == "c":
|
||||
def handle_replay(self, k):
|
||||
if k == "c":
|
||||
if not self.master.client_playback:
|
||||
signals.status_prompt_path.send(
|
||||
self,
|
||||
prompt = "Client replay",
|
||||
prompt = "Client replay path",
|
||||
callback = self.master.client_playback_path
|
||||
)
|
||||
else:
|
||||
@ -59,20 +56,7 @@ class Window(urwid.Frame):
|
||||
),
|
||||
callback = self.master.stop_client_playback_prompt,
|
||||
)
|
||||
elif k == "i":
|
||||
signals.status_prompt.send(
|
||||
self,
|
||||
prompt = "Intercept filter",
|
||||
text = self.master.state.intercept_txt,
|
||||
callback = self.master.set_intercept
|
||||
)
|
||||
elif k == "o":
|
||||
self.master.view_options()
|
||||
elif k == "Q":
|
||||
raise urwid.ExitMainLoop
|
||||
elif k == "q":
|
||||
signals.pop_view_state.send(self)
|
||||
elif k == "S":
|
||||
elif k == "s":
|
||||
if not self.master.server_playback:
|
||||
signals.status_prompt_path.send(
|
||||
self,
|
||||
@ -89,5 +73,33 @@ class Window(urwid.Frame):
|
||||
),
|
||||
callback = self.master.stop_server_playback_prompt,
|
||||
)
|
||||
|
||||
def keypress(self, size, k):
|
||||
k = super(self.__class__, self).keypress(size, k)
|
||||
if k == "?":
|
||||
self.master.view_help(self.helpctx)
|
||||
elif k == "i":
|
||||
signals.status_prompt.send(
|
||||
self,
|
||||
prompt = "Intercept filter",
|
||||
text = self.master.state.intercept_txt,
|
||||
callback = self.master.set_intercept
|
||||
)
|
||||
elif k == "o":
|
||||
self.master.view_options()
|
||||
elif k == "Q":
|
||||
raise urwid.ExitMainLoop
|
||||
elif k == "q":
|
||||
signals.pop_view_state.send(self)
|
||||
elif k == "R":
|
||||
signals.status_prompt_onekey.send(
|
||||
self,
|
||||
prompt = "Replay",
|
||||
keys = (
|
||||
("client", "c"),
|
||||
("server", "s"),
|
||||
),
|
||||
callback = self.handle_replay,
|
||||
)
|
||||
else:
|
||||
return k
|
||||
|
Loading…
Reference in New Issue
Block a user