mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
mitmweb: fix event display
This commit is contained in:
parent
fea6041cde
commit
72dcf70db2
@ -72,8 +72,9 @@ def flow_to_json(flow: mitmproxy.flow.Flow) -> dict:
|
|||||||
return f
|
return f
|
||||||
|
|
||||||
|
|
||||||
def logentry_to_json(e: log.LogEntry):
|
def logentry_to_json(e: log.LogEntry) -> dict:
|
||||||
return {
|
return {
|
||||||
|
"id": id(e), # we just need some kind of id.
|
||||||
"message": e.msg,
|
"message": e.msg,
|
||||||
"level": e.level
|
"level": e.level
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ class EventLog extends Component {
|
|||||||
export default connect(
|
export default connect(
|
||||||
state => ({
|
state => ({
|
||||||
filters: state.eventLog.filters,
|
filters: state.eventLog.filters,
|
||||||
events: state.eventLog.view.data,
|
events: state.eventLog.view,
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
close: toggleVisibility,
|
close: toggleVisibility,
|
||||||
|
@ -49,14 +49,12 @@ export function toggleVisibility() {
|
|||||||
return { type: TOGGLE_VISIBILITY }
|
return { type: TOGGLE_VISIBILITY }
|
||||||
}
|
}
|
||||||
|
|
||||||
let logId = 1 // client-side log ids are odd
|
|
||||||
export function add(message, level = 'web') {
|
export function add(message, level = 'web') {
|
||||||
let data = {
|
let data = {
|
||||||
id: logId,
|
id: Math.random().toString(),
|
||||||
message,
|
message,
|
||||||
level,
|
level,
|
||||||
}
|
}
|
||||||
logId += 2
|
|
||||||
return {
|
return {
|
||||||
type: ADD,
|
type: ADD,
|
||||||
cmd: "add",
|
cmd: "add",
|
||||||
|
Loading…
Reference in New Issue
Block a user