aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/proxyapp.js
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-06-02 23:45:36 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-06-02 23:45:36 -0700
commite31aa39fc28645fe27646b1e6c6f7e876280ed69 (patch)
tree8536a77b278d8182205e8ba757e1e1f00ac67d76 /web/src/js/components/proxyapp.js
parent65fde7f5547f179c80d5858f1ab69583b63fd099 (diff)
parent5321f15defcef641bf5b7ba39e5c9057d562c5f8 (diff)
downloadmitmproxy-e31aa39fc28645fe27646b1e6c6f7e876280ed69.tar.gz
mitmproxy-e31aa39fc28645fe27646b1e6c6f7e876280ed69.tar.bz2
mitmproxy-e31aa39fc28645fe27646b1e6c6f7e876280ed69.zip
Merge branch 'redux-ducks'
Diffstat (limited to 'web/src/js/components/proxyapp.js')
-rw-r--r--web/src/js/components/proxyapp.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/web/src/js/components/proxyapp.js b/web/src/js/components/proxyapp.js
index f47c5bb4..99b64580 100644
--- a/web/src/js/components/proxyapp.js
+++ b/web/src/js/components/proxyapp.js
@@ -1,6 +1,8 @@
import React from "react";
import ReactDOM from "react-dom";
import _ from "lodash";
+import {connect} from 'react-redux'
+import { Route, Router as ReactRouter, hashHistory, Redirect} from "react-router"
import {Splitter} from "./common.js"
import MainView from "./mainview.js";
@@ -8,7 +10,6 @@ import Footer from "./footer.js";
import {Header, MainMenu} from "./header.js";
import EventLog from "./eventlog.js"
import {EventLogStore, FlowStore, SettingsStore} from "../store/store.js";
-import {Query} from "../actions.js";
import {Key} from "../utils.js";
@@ -120,10 +121,10 @@ var ProxyAppMain = React.createClass({
render: function () {
var query = this.getQuery();
var eventlog;
- if (this.props.location.query[Query.SHOW_EVENTLOG]) {
+ if (this.props.showEventLog) {
eventlog = [
<Splitter key="splitter" axis="y"/>,
- <EventLog key="eventlog" updateLocation={this.updateLocation}/>
+ <EventLog key="eventlog"/>
];
} else {
eventlog = null;
@@ -142,13 +143,17 @@ var ProxyAppMain = React.createClass({
}
});
+const AppContainer = connect(
+ state => ({
+ showEventLog: state.eventLog.visible
+ })
+)(ProxyAppMain);
-import { Route, Router as ReactRouter, hashHistory, Redirect} from "react-router";
-export var app = (
+export var App = (
<ReactRouter history={hashHistory}>
<Redirect from="/" to="/flows" />
- <Route path="/" component={ProxyAppMain}>
+ <Route path="/" component={AppContainer}>
<Route path="flows" component={MainView}/>
<Route path="flows/:flowId/:detailTab" component={MainView}/>
<Route path="reports" component={Reports}/>