;
}
});
var ConnectionInfo = React.createClass({
render: function() {
var conn = this.props.conn;
var address = conn.address.address.join(":");
var sni =
; //should be null, but that triggers a React bug.
if(conn.sni){
sni =
TLS SNI:
{conn.sni}
;
}
return (
Address:
{address}
{sni}
);
}
});
var CertificateInfo = React.createClass({
render: function(){
//TODO: We should fetch human-readable certificate representation
// from the server
var flow = this.props.flow;
var client_conn = flow.client_conn;
var server_conn = flow.server_conn;
return (
{client_conn.cert ?
Client Certificate
: null}
{client_conn.cert ?
{client_conn.cert}
: null}
{server_conn.cert ?
Server Certificate
: null}
{server_conn.cert ?
{server_conn.cert}
: null}
);
}
});
var FlowDetailConnectionInfo = React.createClass({
render: function(){
var flow = this.props.flow;
var client_conn = flow.client_conn;
var server_conn = flow.server_conn;
return (
Client Connection
Server Connection
);
}
});
var tabs = {
request: FlowDetailRequest,
response: FlowDetailResponse,
details: FlowDetailConnectionInfo
};
var FlowDetail = React.createClass({
getDefaultProps: function(){
return {
tabs: ["request","response", "details"]
};
},
mixins: [StickyHeadMixin],
nextTab: function(i) {
var currentIndex = this.props.tabs.indexOf(this.props.active);
// JS modulo operator doesn't correct negative numbers, make sure that we are positive.
var nextIndex = (currentIndex + i + this.props.tabs.length) % this.props.tabs.length;
this.props.selectTab(this.props.tabs[nextIndex]);
},
render: function(){
var flow = JSON.stringify(this.props.flow, null, 2);
var Tab = tabs[this.props.active];
return (