aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/flowtable-columns.jsx.js
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-09-19 01:57:50 +0200
committerMaximilian Hils <git@maximilianhils.com>2014-09-19 01:57:50 +0200
commitb5e727da8869baf9d24720debf8ff6c6c22c8500 (patch)
treea310da3e2b14e898a961f71baee738e952dd48b6 /web/src/js/components/flowtable-columns.jsx.js
parentb0374710e4ef934c2ae9b416e5c981e04ed776ed (diff)
downloadmitmproxy-b5e727da8869baf9d24720debf8ff6c6c22c8500.tar.gz
mitmproxy-b5e727da8869baf9d24720debf8ff6c6c22c8500.tar.bz2
mitmproxy-b5e727da8869baf9d24720debf8ff6c6c22c8500.zip
web: flow icons
Diffstat (limited to 'web/src/js/components/flowtable-columns.jsx.js')
-rw-r--r--web/src/js/components/flowtable-columns.jsx.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/web/src/js/components/flowtable-columns.jsx.js b/web/src/js/components/flowtable-columns.jsx.js
index 01130bc1..676b005b 100644
--- a/web/src/js/components/flowtable-columns.jsx.js
+++ b/web/src/js/components/flowtable-columns.jsx.js
@@ -28,7 +28,27 @@ var IconColumn = React.createClass({
},
render: function(){
var flow = this.props.flow;
- return <td className="col-icon"><div className="resource-icon resource-icon-plain"></div></td>;
+ var contentType = ResponseUtils.getContentType(flow.response);
+
+ //TODO: We should assign a type to the flow somewhere else.
+ var icon;
+ if(flow.response.code == 304) {
+ icon = "resource-icon-not-modified"
+ } else if(300 <= flow.response.code && flow.response.code < 400) {
+ icon = "resource-icon-redirect";
+ } else if(contentType.indexOf("image") >= 0) {
+ icon = "resource-icon-image";
+ } else if (contentType.indexOf("javascript") >= 0) {
+ icon = "resource-icon-js";
+ } else if (contentType.indexOf("css") >= 0) {
+ icon = "resource-icon-css";
+ } else if (contentType.indexOf("html") >= 0) {
+ icon = "resource-icon-document";
+ } else {
+ icon = "resource-icon-plain";
+ }
+ icon += " resource-icon";
+ return <td className="col-icon"><div className={icon}></div></td>;
}
});