aboutsummaryrefslogtreecommitdiffstats
path: root/web/src
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-06-17 21:06:17 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-06-17 21:06:17 -0700
commitf203936fbf51b04f424666f9d2dd63bce8c84404 (patch)
treee6e6d5ac969710292833662d5f1f85e1caed86ab /web/src
parent6a41ea91714711f2edc07af0329621de3191aa22 (diff)
downloadmitmproxy-f203936fbf51b04f424666f9d2dd63bce8c84404.tar.gz
mitmproxy-f203936fbf51b04f424666f9d2dd63bce8c84404.tar.bz2
mitmproxy-f203936fbf51b04f424666f9d2dd63bce8c84404.zip
add setInterceptPattern action creator
Diffstat (limited to 'web/src')
-rw-r--r--web/src/js/components/Header/MainMenu.jsx11
-rw-r--r--web/src/js/ducks/settings.js5
2 files changed, 13 insertions, 3 deletions
diff --git a/web/src/js/components/Header/MainMenu.jsx b/web/src/js/components/Header/MainMenu.jsx
index 86bf961a..7b0b542c 100644
--- a/web/src/js/components/Header/MainMenu.jsx
+++ b/web/src/js/components/Header/MainMenu.jsx
@@ -1,9 +1,10 @@
import React, { Component, PropTypes } from 'react'
-import { SettingsActions } from "../../actions.js"
import FilterInput from './FilterInput'
import { Query } from '../../actions.js'
+import {setInterceptPattern} from "../../ducks/settings"
+import { connect } from 'react-redux'
-export default class MainMenu extends Component {
+class MainMenu extends Component {
static title = 'Start'
static route = 'flows'
@@ -28,7 +29,7 @@ export default class MainMenu extends Component {
}
onInterceptChange(val) {
- SettingsActions.update({ intercept: val })
+ this.props.setInterceptPattern(val);
}
render() {
@@ -71,3 +72,7 @@ export default class MainMenu extends Component {
)
}
}
+
+export default connect(undefined, {
+ setInterceptPattern
+})(MainMenu);
diff --git a/web/src/js/ducks/settings.js b/web/src/js/ducks/settings.js
index 479d1300..73c62120 100644
--- a/web/src/js/ducks/settings.js
+++ b/web/src/js/ducks/settings.js
@@ -70,3 +70,8 @@ export function fetchSettings() {
// TODO: Error handling
}
}
+
+export function setInterceptPattern(intercept) {
+ return dispatch =>
+ fetchApi.put("/settings", {intercept})
+}