diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-09-19 17:56:54 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-09-19 17:56:54 +0200 |
commit | 818c5918b648b29f3692bd2cc6ebcf326d4d2497 (patch) | |
tree | 50346a97f281fb4138766f4c6deca5f789995a66 /web/src/js/components/flowtable-columns.jsx.js | |
parent | b5e727da8869baf9d24720debf8ff6c6c22c8500 (diff) | |
download | mitmproxy-818c5918b648b29f3692bd2cc6ebcf326d4d2497.tar.gz mitmproxy-818c5918b648b29f3692bd2cc6ebcf326d4d2497.tar.bz2 mitmproxy-818c5918b648b29f3692bd2cc6ebcf326d4d2497.zip |
web: display flow connection info
Diffstat (limited to 'web/src/js/components/flowtable-columns.jsx.js')
-rw-r--r-- | web/src/js/components/flowtable-columns.jsx.js | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/web/src/js/components/flowtable-columns.jsx.js b/web/src/js/components/flowtable-columns.jsx.js index 676b005b..728bc953 100644 --- a/web/src/js/components/flowtable-columns.jsx.js +++ b/web/src/js/components/flowtable-columns.jsx.js @@ -28,25 +28,32 @@ var IconColumn = React.createClass({ }, render: function(){ var flow = this.props.flow; - 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 { + if(flow.response){ + 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"; + } + } + if(!icon){ icon = "resource-icon-plain"; } + + icon += " resource-icon"; return <td className="col-icon"><div className={icon}></div></td>; } @@ -123,7 +130,7 @@ var TimeColumn = React.createClass({ var flow = this.props.flow; var time; if(flow.response){ - time = Math.round(1000 * (flow.response.timestamp_end - flow.request.timestamp_start))+"ms"; + time = formatTimeDelta(1000 * (flow.response.timestamp_end - flow.request.timestamp_start)); } else { time = "..."; } |