Skip to content

Commit a169c1f

Browse files
committed
add packets destinations (server and client) in packets list as header bar
1 parent 63d89b7 commit a169c1f

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

data/inspector/components/packets-panel.js

+32-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,37 @@ const { PacketsToolbar } = require("./packets-toolbar");
1717
const { Splitter } = require("./splitter");
1818

1919
// Shortcuts
20-
const { DIV } = Reps.DOM;
20+
const { DIV, SPAN } = Reps.DOM;
21+
22+
var PacketsDirectionsBar = React.createClass({
23+
/** @lends PacketsDirectionsBar */
24+
25+
displayName: "PacketsDirectionsBar",
26+
27+
render: function() {
28+
return DIV({
29+
id: "packetsDirectionsBar",
30+
style: {
31+
position: "relative",
32+
height: "24px"
33+
}
34+
}, SPAN({ style: {
35+
position: "absolute",
36+
top: "0px",
37+
left: "10px",
38+
fontWeight: "bold",
39+
fontSize: "1.2em"
40+
}, key: "server"}, "Server"),
41+
SPAN({ style: {
42+
position: "absolute",
43+
top: "0px",
44+
right: "10px",
45+
fontWeight: "bold",
46+
fontSize: "1.2em"
47+
}, key: "client"}, "Client")
48+
);
49+
}
50+
});
2151

2252
/**
2353
* @template This template renders 'Packets' tab body.
@@ -42,6 +72,7 @@ var PacketsPanel = React.createClass({
4272
packetCacheEnabled: this.props.packetCacheEnabled,
4373
paused: this.props.paused
4474
}),
75+
React.createElement(PacketsDirectionsBar, {}),
4576
PacketList({
4677
data: this.props.packets,
4778
actions: this.props.actions,

data/inspector/css/packets-panel.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155

156156
.packetsPanelBox .list {
157157
/* xxxHonza: minus the toolbar height*/
158-
height: calc(100% - 30px);
158+
height: calc(100% - 54px);
159159
overflow: auto;
160160
padding: 10px;
161161
}

0 commit comments

Comments
 (0)