From d2475e6a146534b5e7aaf2cc7b0b9a75e418415e Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 13 Sep 2014 23:05:12 +0200 Subject: web: start gui --- web/src/js/mitmproxy.react.js | 60 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 web/src/js/mitmproxy.react.js (limited to 'web/src/js/mitmproxy.react.js') diff --git a/web/src/js/mitmproxy.react.js b/web/src/js/mitmproxy.react.js new file mode 100644 index 00000000..2a2ee910 --- /dev/null +++ b/web/src/js/mitmproxy.react.js @@ -0,0 +1,60 @@ +/** @jsx React.DOM */ + +var App = React.createClass({ + getInitialState: function () { + return { + settings: {} //TODO: How explicit should we get here? + //List all subattributes? + }; + }, + componentDidMount: function () { + //TODO: Replace DummyStore with real settings over WS (https://facebook.github.io/react/tips/initial-ajax.html) + //TODO: Is there a sensible place where we can store this? + var settings = new DummySettings({ + version: "0.12" + }); + settings.addChangeListener(this._onSettingsChange); + + //This would be async in some way or another. + this._onSettingsChange(null, settings); + }, + _onSettingsChange: function(event, settings){ + this.setState({settings: settings.getAll()}); + }, + render: function () { + return ( +
+
+
+ +
+
+
+ ); + } +}); + +var Traffic = React.createClass({ + render: function(){ + var json = JSON.stringify(this.props, null, 4); + var i = 5; + while(i--) json += json; + return (
{json}
); + } +}); + +var Reports = React.createClass({ + render: function(){ + return (
Report Editor
); + } +}); + +var routes = ( + + + + + + + +); \ No newline at end of file -- cgit v1.2.3