mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-03-26 08:54:48 +08:00
Closes #1960 'Z' removes unmarked flows
This commit is contained in:
@@ -230,6 +230,17 @@ class View(collections.Sequence):
|
||||
self.sig_view_refresh.send(self)
|
||||
self.sig_store_refresh.send(self)
|
||||
|
||||
def clear_not_marked(self):
|
||||
"""
|
||||
Clears only the unmarked flows.
|
||||
"""
|
||||
for flow in self._store.copy().values():
|
||||
if not flow.marked:
|
||||
self._store.pop(flow.id)
|
||||
|
||||
self._refilter()
|
||||
self.sig_store_refresh.send(self)
|
||||
|
||||
def add(self, f: mitmproxy.flow.Flow) -> bool:
|
||||
"""
|
||||
Adds a flow to the state. If the flow already exists, it is
|
||||
|
||||
@@ -35,6 +35,7 @@ def _mkhelp():
|
||||
("W", "stream flows to file"),
|
||||
("X", "kill and delete flow, even if it's mid-intercept"),
|
||||
("z", "clear flow list or eventlog"),
|
||||
("Z", "clear unmarked flows"),
|
||||
("tab", "tab between eventlog and flow list"),
|
||||
("enter", "view flow"),
|
||||
("|", "run script on this flow"),
|
||||
@@ -354,6 +355,8 @@ class FlowListBox(urwid.ListBox):
|
||||
self.master.view.update(f)
|
||||
elif key == "z":
|
||||
self.master.view.clear()
|
||||
elif key == "Z":
|
||||
self.master.view.clear_not_marked()
|
||||
elif key == "e":
|
||||
self.master.toggle_eventlog()
|
||||
elif key == "g":
|
||||
|
||||
Reference in New Issue
Block a user