Permalink
Browse files

[web] various fixes

  • Loading branch information...
1 parent d1c7b20 commit d854e08653ccee12119266e2cc3f5d6c279341e5 @mhils mhils committed Dec 11, 2016
@@ -327,6 +327,9 @@ def intercept(self, f):
def resume(self, f):
self.update(f)
+ def kill(self, f):
+ self.update(f)
+
class Focus:
"""
View
@@ -169,6 +169,8 @@ def kill(self, master):
self.reply.take()
self.reply.kill(force=True)
self.reply.commit()
+ self.live = False
+ master.addons("kill", self)
def intercept(self, master):
"""
@@ -190,4 +192,4 @@ def resume(self, master):
self.intercepted = False
self.reply.ack()
self.reply.commit()
- master.addons("intercept", self)
+ master.addons("resume", self)
@@ -31,7 +31,8 @@ def flow_to_json(flow: mitmproxy.flow.Flow) -> dict:
"intercepted": flow.intercepted,
"client_conn": flow.client_conn.get_state(),
"server_conn": flow.server_conn.get_state(),
- "type": flow.type
+ "type": flow.type,
+ "modified": flow.modified(),
}
if flow.error:
f["error"] = flow.error.get_state()
@@ -222,17 +223,30 @@ def post(self):
self.master.events.clear()
-class AcceptFlows(RequestHandler):
+class ResumeFlows(RequestHandler):
def post(self):
for f in self.view:
f.resume(self.master)
-class AcceptFlow(RequestHandler):
+class KillFlows(RequestHandler):
+ def post(self):
+ for f in self.view:
+ if f.killable:
+ f.kill(self.master)
+
+
+class ResumeFlow(RequestHandler):
def post(self, flow_id):
self.flow.resume(self.master)
+class KillFlow(RequestHandler):
+ def post(self, flow_id):
+ if self.flow.killable:
+ self.flow.kill(self.master)
+
+
class FlowHandler(RequestHandler):
def delete(self, flow_id):
if self.flow.killable:
@@ -410,9 +424,11 @@ def __init__(self, master, debug):
(r"/events", Events),
(r"/flows", Flows),
(r"/flows/dump", DumpFlows),
- (r"/flows/accept", AcceptFlows),
+ (r"/flows/resume", ResumeFlows),
+ (r"/flows/kill", KillFlows),
(r"/flows/(?P<flow_id>[0-9a-f\-]+)", FlowHandler),
- (r"/flows/(?P<flow_id>[0-9a-f\-]+)/accept", AcceptFlow),
+ (r"/flows/(?P<flow_id>[0-9a-f\-]+)/resume", ResumeFlow),
+ (r"/flows/(?P<flow_id>[0-9a-f\-]+)/kill", KillFlow),
(r"/flows/(?P<flow_id>[0-9a-f\-]+)/duplicate", DuplicateFlow),
(r"/flows/(?P<flow_id>[0-9a-f\-]+)/replay", ReplayFlow),
(r"/flows/(?P<flow_id>[0-9a-f\-]+)/revert", RevertFlow),
@@ -68,7 +68,7 @@ def _sig_view_remove(self, view, flow):
app.ClientConnection.broadcast(
resource="flows",
cmd="remove",
- data=dict(id=flow.id)
+ data=flow.id
)
def _sig_view_refresh(self, view):
@@ -130,28 +130,98 @@ body,
margin: 1px 0 0px;
}
header {
- padding-top: 0.5em;
+ padding-top: 6px;
background-color: white;
}
-header .menu {
- padding: 10px;
+header menu {
+ display: block;
+ margin: 0;
+ padding: 0;
border-bottom: solid #a6a6a6 1px;
+ height: 85px;
+ overflow: visible;
+}
+.menu-group {
+ margin: 0 3px;
+ display: inline-block;
+ height: 85px;
+ vertical-align: top;
+}
+.menu-content {
+ height: 69px;
+ text-align: center;
+}
+.menu-content > .btn {
+ height: 69px;
+ text-align: center;
+ margin: 0 1px;
+ padding: 12px 5px;
+ border: none;
+ border-radius: 0;
+}
+.menu-content > .btn i {
+ font-size: 20px;
+ display: block;
+ margin: 0 auto 5px;
+}
+.menu-entry {
+ text-align: left;
+ height: 23px;
+ line-height: 1;
+ padding: 0.5rem 1rem;
}
-.menu-row {
+.menu-entry label {
+ font-size: 1.2rem;
+ font-weight: normal;
+ margin: 0;
+}
+.menu-entry input[type=checkbox] {
+ margin: 0 2px;
+ vertical-align: middle;
+}
+.menu-legend {
+ height: 16px;
+ text-align: center;
+ font-size: 12px;
+ padding: 0 5px;
+}
+.menu-group + .menu-group:before {
+ margin-left: -3px;
+ content: " ";
+ border-left: solid 1px #e6e6e6;
+ margin-top: 10px;
+ height: 65px;
+ position: absolute;
+}
+.menu-main {
margin-left: -2px;
margin-right: -3px;
+ padding: 2px 5px;
}
.filter-input {
position: relative;
min-height: 1px;
padding-left: 2.5px;
padding-right: 2.5px;
- margin-bottom: 5px;
+ padding: 2.5px;
}
@media (min-width: 768px) {
.filter-input {
float: left;
- width: 25%;
+ width: 41.66666667%;
+ }
+}
+@media (max-width: 767px) {
+ .filter-input {
+ padding: 2px 2.5px;
+ }
+ .filter-input > .form-control,
+ .filter-input > .input-group-addon,
+ .filter-input > .input-group-btn > .btn {
+ height: 23.5px;
+ padding: 1px 5px;
+ font-size: 12px;
+ line-height: 1.5;
}
}
.filter-input .popover {
@@ -258,6 +328,10 @@ header .menu {
.flow-table .col-path .fa-pause {
color: #ff8000;
}
+.flow-table .col-path .fa-exclamation,
+.flow-table .col-path .fa-times {
+ color: darkred;
+}
.flow-table .col-method {
width: 60px;
}
Oops, something went wrong.

0 comments on commit d854e08

Please sign in to comment.