blob: e0cee365357f369d0bd38bd250dd5e99af276216 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
/** @jsx React.DOM */
var TLSColumn = React.createClass({
statics: {
renderTitle: function(){
return <th key="tls" className="col-tls"></th>;
}
},
render: function(){
var flow = this.props.flow;
var ssl = (flow.request.scheme == "https");
return <td className={ssl ? "col-tls-https" : "col-tls-http"}></td>;
}
});
var IconColumn = React.createClass({
statics: {
renderTitle: function(){
return <th key="icon" className="col-icon"></th>;
}
},
render: function(){
var flow = this.props.flow;
return <td className="resource-icon resource-icon-plain"></td>;
}
});
var PathColumn = React.createClass({
statics: {
renderTitle: function(){
return <th key="path" className="col-path">Path</th>;
}
},
render: function(){
var flow = this.props.flow;
return <td>{flow.request.scheme + "://" + flow.request.host + flow.request.path}</td>;
}
});
var MethodColumn = React.createClass({
statics: {
renderTitle: function(){
return <th key="method" className="col-method">Method</th>;
}
},
render: function(){
var flow = this.props.flow;
return <td>{flow.request.method}</td>;
}
});
var StatusColumn = React.createClass({
statics: {
renderTitle: function(){
return <th key="status" className="col-status">Status</th>;
}
},
render: function(){
var flow = this.props.flow;
var status;
if(flow.response){
status = flow.response.code;
} else {
status = null;
}
return <td>{status}</td>;
}
});
var TimeColumn = React.createClass({
statics: {
renderTitle: function(){
return <th key="time" className="col-time">Time</th>;
}
},
render: function(){
var flow = this.props.flow;
var time;
if(flow.response){
time = Math.round(1000 * (flow.response.timestamp_end - flow.request.timestamp_start))+"ms";
} else {
time = "...";
}
return <td>{time}</td>;
}
});
var all_columns = [TLSColumn, IconColumn, PathColumn, MethodColumn, StatusColumn, TimeColumn];
|