diff options
author | Maximilian Hils <git@maximilianhils.com> | 2014-09-18 00:01:45 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2014-09-18 00:01:45 +0200 |
commit | 6a161be6b4c526fcc5f6581c7faff00a2c976f37 (patch) | |
tree | 6b99c30538a57e096c4fd01a923fc8542e90e6e4 /web/src/js/components/proxyapp.jsx.js | |
parent | b99de36b24e4687e35069fbfa18727519f23ea35 (diff) | |
download | mitmproxy-6a161be6b4c526fcc5f6581c7faff00a2c976f37.tar.gz mitmproxy-6a161be6b4c526fcc5f6581c7faff00a2c976f37.tar.bz2 mitmproxy-6a161be6b4c526fcc5f6581c7faff00a2c976f37.zip |
.jsx -> .jsx.js
Rename jsx files to be compatible with Chrome Dev Tools and
Workspace Mapping.
Diffstat (limited to 'web/src/js/components/proxyapp.jsx.js')
-rw-r--r-- | web/src/js/components/proxyapp.jsx.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/web/src/js/components/proxyapp.jsx.js b/web/src/js/components/proxyapp.jsx.js new file mode 100644 index 00000000..63998ffe --- /dev/null +++ b/web/src/js/components/proxyapp.jsx.js @@ -0,0 +1,46 @@ +/** @jsx React.DOM */ + +//TODO: Move out of here, just a stub. +var Reports = React.createClass({ + render: function () { + return <div>ReportEditor</div>; + } +}); + + +var ProxyAppMain = React.createClass({ + getInitialState: function () { + return { settings: SettingsStore.getAll() }; + }, + componentDidMount: function () { + SettingsStore.addListener("change", this.onSettingsChange); + }, + componentWillUnmount: function () { + SettingsStore.removeListener("change", this.onSettingsChange); + }, + onSettingsChange: function () { + console.log("onSettingsChange"); + this.setState({settings: SettingsStore.getAll()}); + }, + render: function () { + return ( + <div id="container"> + <Header settings={this.state.settings}/> + <div id="main"><this.props.activeRouteHandler/></div> + {this.state.settings.showEventLog ? <EventLog/> : null} + <Footer settings={this.state.settings}/> + </div> + ); + } +}); + + +var ProxyApp = ( + <ReactRouter.Routes location="hash"> + <ReactRouter.Route name="app" path="/" handler={ProxyAppMain}> + <ReactRouter.Route name="main" handler={FlowTable}/> + <ReactRouter.Route name="reports" handler={Reports}/> + <ReactRouter.Redirect to="main"/> + </ReactRouter.Route> + </ReactRouter.Routes> + ); |