mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 10:16:27 +00:00
web: minor fixes
This commit is contained in:
parent
818c5918b6
commit
aa6856786b
@ -690,13 +690,13 @@ var IconColumn = React.createClass({displayName: 'IconColumn',
|
|||||||
icon = "resource-icon-not-modified";
|
icon = "resource-icon-not-modified";
|
||||||
} else if(300 <= flow.response.code && flow.response.code < 400) {
|
} else if(300 <= flow.response.code && flow.response.code < 400) {
|
||||||
icon = "resource-icon-redirect";
|
icon = "resource-icon-redirect";
|
||||||
} else if(contentType.indexOf("image") >= 0) {
|
} else if(contentType && contentType.indexOf("image") >= 0) {
|
||||||
icon = "resource-icon-image";
|
icon = "resource-icon-image";
|
||||||
} else if (contentType.indexOf("javascript") >= 0) {
|
} else if (contentType && contentType.indexOf("javascript") >= 0) {
|
||||||
icon = "resource-icon-js";
|
icon = "resource-icon-js";
|
||||||
} else if (contentType.indexOf("css") >= 0) {
|
} else if (contentType && contentType.indexOf("css") >= 0) {
|
||||||
icon = "resource-icon-css";
|
icon = "resource-icon-css";
|
||||||
} else if (contentType.indexOf("html") >= 0) {
|
} else if (contentType && contentType.indexOf("html") >= 0) {
|
||||||
icon = "resource-icon-document";
|
icon = "resource-icon-document";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -763,9 +763,11 @@ var SizeColumn = React.createClass({displayName: 'SizeColumn',
|
|||||||
},
|
},
|
||||||
render: function(){
|
render: function(){
|
||||||
var flow = this.props.flow;
|
var flow = this.props.flow;
|
||||||
var size = formatSize(
|
var total = flow.request.contentLength;
|
||||||
flow.request.contentLength +
|
if(flow.response){
|
||||||
(flow.response.contentLength || 0));
|
total += flow.response.contentLength;
|
||||||
|
}
|
||||||
|
var size = formatSize(total);
|
||||||
return React.DOM.td({className: "col-size"}, size);
|
return React.DOM.td({className: "col-size"}, size);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -39,13 +39,13 @@ var IconColumn = React.createClass({
|
|||||||
icon = "resource-icon-not-modified";
|
icon = "resource-icon-not-modified";
|
||||||
} else if(300 <= flow.response.code && flow.response.code < 400) {
|
} else if(300 <= flow.response.code && flow.response.code < 400) {
|
||||||
icon = "resource-icon-redirect";
|
icon = "resource-icon-redirect";
|
||||||
} else if(contentType.indexOf("image") >= 0) {
|
} else if(contentType && contentType.indexOf("image") >= 0) {
|
||||||
icon = "resource-icon-image";
|
icon = "resource-icon-image";
|
||||||
} else if (contentType.indexOf("javascript") >= 0) {
|
} else if (contentType && contentType.indexOf("javascript") >= 0) {
|
||||||
icon = "resource-icon-js";
|
icon = "resource-icon-js";
|
||||||
} else if (contentType.indexOf("css") >= 0) {
|
} else if (contentType && contentType.indexOf("css") >= 0) {
|
||||||
icon = "resource-icon-css";
|
icon = "resource-icon-css";
|
||||||
} else if (contentType.indexOf("html") >= 0) {
|
} else if (contentType && contentType.indexOf("html") >= 0) {
|
||||||
icon = "resource-icon-document";
|
icon = "resource-icon-document";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -112,9 +112,11 @@ var SizeColumn = React.createClass({
|
|||||||
},
|
},
|
||||||
render: function(){
|
render: function(){
|
||||||
var flow = this.props.flow;
|
var flow = this.props.flow;
|
||||||
var size = formatSize(
|
var total = flow.request.contentLength;
|
||||||
flow.request.contentLength +
|
if(flow.response){
|
||||||
(flow.response.contentLength || 0));
|
total += flow.response.contentLength;
|
||||||
|
}
|
||||||
|
var size = formatSize(total);
|
||||||
return <td className="col-size">{size}</td>;
|
return <td className="col-size">{size}</td>;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user