mitmweb: fix event display

This commit is contained in:
Maximilian Hils 2016-11-23 00:12:45 +01:00
parent fea6041cde
commit 72dcf70db2
3 changed files with 4 additions and 5 deletions

View File

@ -72,8 +72,9 @@ def flow_to_json(flow: mitmproxy.flow.Flow) -> dict:
return f
def logentry_to_json(e: log.LogEntry):
def logentry_to_json(e: log.LogEntry) -> dict:
return {
"id": id(e), # we just need some kind of id.
"message": e.msg,
"level": e.level
}

View File

@ -70,7 +70,7 @@ class EventLog extends Component {
export default connect(
state => ({
filters: state.eventLog.filters,
events: state.eventLog.view.data,
events: state.eventLog.view,
}),
{
close: toggleVisibility,

View File

@ -49,14 +49,12 @@ export function toggleVisibility() {
return { type: TOGGLE_VISIBILITY }
}
let logId = 1 // client-side log ids are odd
export function add(message, level = 'web') {
let data = {
id: logId,
id: Math.random().toString(),
message,
level,
}
logId += 2
return {
type: ADD,
cmd: "add",