aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/ducks
diff options
context:
space:
mode:
authorClemens <cle1000.cb@gmail.com>2016-07-19 16:13:26 +0200
committerClemens <cle1000.cb@gmail.com>2016-07-19 16:13:26 +0200
commit281f20ef1e9ac33a7e210ba562eb2914f6d187e6 (patch)
tree282dc25fc6020a6a773c5d517a2ec7f34c26c255 /web/src/js/ducks
parent698fb11132598a38851383f805dde5ca4d2a046d (diff)
downloadmitmproxy-281f20ef1e9ac33a7e210ba562eb2914f6d187e6.tar.gz
mitmproxy-281f20ef1e9ac33a7e210ba562eb2914f6d187e6.tar.bz2
mitmproxy-281f20ef1e9ac33a7e210ba562eb2914f6d187e6.zip
added flow_content update
Diffstat (limited to 'web/src/js/ducks')
-rw-r--r--web/src/js/ducks/ui.js43
1 files changed, 38 insertions, 5 deletions
diff --git a/web/src/js/ducks/ui.js b/web/src/js/ducks/ui.js
index f745f0af..ccd17eb6 100644
--- a/web/src/js/ducks/ui.js
+++ b/web/src/js/ducks/ui.js
@@ -9,6 +9,9 @@ export const UPDATE_QUERY = 'UI_UPDATE_QUERY'
export const SELECT_TAB = 'UI_SELECT_TAB'
export const SET_PROMPT = 'UI_SET_PROMPT'
export const SET_DISPLAY_LARGE = 'UI_SET_DISPLAY_LARGE'
+export const OPEN_FLOW_EDITOR= 'UI_OPEN_FLOW_EDITOR'
+export const CLOSE_FLOW_EDITOR = 'UI_CLOSE_FLOW_EDITOR'
+export const SET_MODIFIED_FLOW_CONTENT = 'UI_SET_MODIFIED_FLOW'
const defaultState = {
activeMenu: 'Start',
@@ -18,7 +21,9 @@ const defaultState = {
promptOpen: false,
contentView: 'ViewAuto',
query: {},
- panel: 'request'
+ panel: 'request',
+ modifiedFlow: {headers: "", content: ""},
+ isFlowEditorOpen: false
}
export default function reducer(state = defaultState, action) {
@@ -31,9 +36,10 @@ export default function reducer(state = defaultState, action) {
}
case flowsActions.SELECT:
+ let s = {...state, isFlowEditorOpen: false}
if (action.flowIds.length && !state.isFlowSelected) {
return {
- ...state,
+ ...s,
displayLarge: false,
activeMenu: 'Flow',
isFlowSelected: true,
@@ -46,14 +52,14 @@ export default function reducer(state = defaultState, action) {
activeMenu = 'Start'
}
return {
- ...state,
+ ...s,
activeMenu,
isFlowSelected: false,
}
}
return {
- ...state,
+ ...s,
displayLarge: false,
}
@@ -78,6 +84,7 @@ export default function reducer(state = defaultState, action) {
case SELECT_TAB:
return {
...state,
+ isFlowEditorOpen: false,
panel: action.panel
}
@@ -92,7 +99,21 @@ export default function reducer(state = defaultState, action) {
...state,
displayLarge: action.displayLarge,
}
-
+ case OPEN_FLOW_EDITOR:
+ return {
+ ...state,
+ isFlowEditorOpen: true
+ }
+ case CLOSE_FLOW_EDITOR:
+ return {
+ ...state,
+ isFlowEditorOpen: false
+ }
+ case SET_MODIFIED_FLOW_CONTENT:
+ return{
+ ...state,
+ modifiedFlow: {...state.modifiedFlow, content: action.content}
+ }
default:
return state
}
@@ -126,6 +147,18 @@ export function setDisplayLarge(displayLarge) {
return { type: SET_DISPLAY_LARGE, displayLarge }
}
+export function openFlowEditor(){
+ return { type: OPEN_FLOW_EDITOR }
+}
+
+export function closeFlowEditor(){
+ return { type: CLOSE_FLOW_EDITOR }
+}
+
+export function setModifiedFlowContent(content) {
+ return { type: SET_MODIFIED_FLOW_CONTENT, content }
+}
+
export function onKeyDown(e) {
if (e.ctrlKey) {
return () => {