Skip to content
This repository was archived by the owner on Aug 13, 2018. It is now read-only.

Commit 0e17cab

Browse files
committed
#32 WAMP support
1 parent f15d5c9 commit 0e17cab

File tree

5 files changed

+898
-3
lines changed

5 files changed

+898
-3
lines changed

chrome/locale/en-US/websocket-monitor.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,17 @@ websocketmonitor.Time=Time
1515
websocketmonitor.SocketIO=Socket.IO
1616
websocketmonitor.SockJS=SockJS
1717
websocketmonitor.JSON=JSON
18+
19+
# LOCALIZATION NOTE (websocketmonitor.WAMP): A label used as a title for side
20+
# panel that displays WAMP WS messages.
21+
websocketmonitor.WAMP=WAMP
22+
23+
# LOCALIZATION NOTE (websocketmonitor.option.tabularView): A label and tooltip
24+
# used for a toolbar button that allows switching the frame list to
25+
# Tabular view
1826
websocketmonitor.option.tabularView=Tabular View
1927
websocketmonitor.option.tip.tabularView=Use tabular view for list of sent and received frames.
28+
2029
pluralRule=1
2130

2231
websocketmonitor.summary.frameCount=%1$S frame;%1$S frames

data/components/sidebar.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const { PayloadTab } = createFactories(require("./payload-tab"));
1818
const { SocketIOTab } = createFactories(require("./socketio-tab"));
1919
const { SockJSTab } = createFactories(require("./sockjs-tab"));
2020
const { JSONTab } = createFactories(require("./json-tab"));
21+
const { WampTab } = createFactories(require("./wamp-tab"));
2122

2223
/**
2324
* @template This template represents a list of packets displayed
@@ -69,6 +70,14 @@ var Sidebar = React.createClass({
6970
));
7071
}
7172

73+
if (selectedFrame && selectedFrame.wamp) {
74+
tabs.push(
75+
TabPanel({className: "wamp", key: "wamp",
76+
title: Locale.$STR("websocketmonitor.WAMP")},
77+
WampTab(this.props)
78+
));
79+
}
80+
7281
if (selectedFrame && selectedFrame.json) {
7382
tabs.push(
7483
TabPanel({className: "json", key: "json",

data/components/wamp-tab.js

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* See license.txt for terms of usage */
2+
3+
define(function(require, exports/*, module*/) {
4+
5+
"use strict";
6+
7+
// Dependencies
8+
const React = require("react");
9+
10+
// Firebug SDK
11+
const { Reps } = require("reps/repository");
12+
const { TreeView } = require("reps/tree-view");
13+
14+
// Shortcuts
15+
const { DIV } = Reps.DOM;
16+
17+
/**
18+
* Component responsible for rendering the WAMP tab.
19+
*/
20+
var WampTab = React.createClass({
21+
/** @lends WampTab */
22+
23+
displayName: "WampTab",
24+
25+
render: function() {
26+
var selectedFrame = this.props.selection || {};
27+
var data = selectedFrame.wamp;
28+
29+
return (
30+
DIV({className: "details"},
31+
TreeView({key: "WampTabTree", data: data})
32+
)
33+
);
34+
}
35+
});
36+
37+
// Exports from this module
38+
exports.WampTab = WampTab;
39+
});
40+

0 commit comments

Comments
 (0)