From 4ca720b55680e40b3a4361141a2ad39f9de81111 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Wed, 17 Sep 2014 21:14:55 +0200 Subject: add features to the traffic table, introduce image spriting --- web/src/js/components/flowtable.jsx | 63 ++++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 12 deletions(-) (limited to 'web/src/js/components') diff --git a/web/src/js/components/flowtable.jsx b/web/src/js/components/flowtable.jsx index 5e9f6718..a94e559f 100644 --- a/web/src/js/components/flowtable.jsx +++ b/web/src/js/components/flowtable.jsx @@ -4,7 +4,10 @@ var FlowRow = React.createClass({ render: function(){ var flow = this.props.flow; var columns = this.props.columns.map(function(column){ - return column({flow: flow}); + return column({ + key: column.displayName, + flow: flow + }); }.bind(this)); return {columns}; } @@ -22,55 +25,89 @@ var FlowTableHead = React.createClass({ var FlowTableBody = React.createClass({ render: function(){ var rows = this.props.flows.map(function(flow){ - return + //TODO: Add UUID + return ; }.bind(this)); return {rows}; } }); + +var TLSColumn = React.createClass({ + statics: { + renderTitle: function(){ + return ; + } + }, + render: function(){ + var flow = this.props.flow; + var ssl = (flow.request.scheme == "https"); + return ; + } +}); + + +var IconColumn = React.createClass({ + statics: { + renderTitle: function(){ + return ; + } + }, + render: function(){ + var flow = this.props.flow; + return ; + } +}); + var PathColumn = React.createClass({ statics: { renderTitle: function(){ - return Path; + return Path; } }, render: function(){ var flow = this.props.flow; - return {flow.request.scheme + "://" + flow.request.host + flow.request.path}; + return {flow.request.scheme + "://" + flow.request.host + flow.request.path}; } }); + + var MethodColumn = React.createClass({ statics: { renderTitle: function(){ - return Method; + return Method; } }, render: function(){ var flow = this.props.flow; - return {flow.request.method}; + return {flow.request.method}; } }); + + var StatusColumn = React.createClass({ statics: { renderTitle: function(){ - return Status; + return Status; } }, render: function(){ var flow = this.props.flow; var status; if(flow.response){ - status = flow.response.code + " " + flow.response.msg; + status = flow.response.code; } else { status = null; } - return {status}; + return {status}; } }); + + var TimeColumn = React.createClass({ statics: { renderTitle: function(){ - return Time; + return Time; } }, render: function(){ @@ -81,11 +118,13 @@ var TimeColumn = React.createClass({ } else { time = "..."; } - return {time}; + return {time}; } }); -var all_columns = [PathColumn, MethodColumn, StatusColumn, TimeColumn]; + +var all_columns = [TLSColumn, IconColumn, PathColumn, MethodColumn, StatusColumn, TimeColumn]; + var FlowTable = React.createClass({ getInitialState: function () { -- cgit v1.2.3